Skip to content

Commit 1ea9ff4

Browse files
committed
impl: request a new toke when old one is expired
- resolves #130
1 parent 8707ce7 commit 1ea9ff4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
### Added
88
- ability to open a template in the Dashboard
99
- ability to sort by workspace name, or by template name or by workspace status
10+
- a new token is requested when the one persisted is expired
1011

1112
### Changed
1213
- renamed the plugin from `Coder Gateway` to `Gateway`

src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,13 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
319319
tfUrl?.text = url
320320

321321
poller?.cancel()
322-
loginAndLoadWorkspace(token)
322+
try {
323+
coderClient.initClientSession(url.toURL(), token)
324+
loginAndLoadWorkspace(token)
325+
} catch (e: AuthenticationResponseException) {
326+
// probably the token is expired
327+
askTokenAndOpenSession()
328+
}
323329
}
324330
}
325331
updateWorkspaceActions()

0 commit comments

Comments
 (0)