Skip to content

Commit 2441331

Browse files
committed
fix: authentication sequence for last successful connection
- if the last successful connection fail to connect then users are blocked from reaching the main window and select another deployment. - resolves #172
1 parent 0444aea commit 2441331

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Fixed
88
- terminal link is now correct when host ends in `/`
9+
- improved resiliency and error handling trying to open last successful connection
910

1011
## 2.1.6-eap.0 - 2023-02-02
1112

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,20 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
321321
try {
322322
coderClient.initClientSession(url.toURL(), token)
323323
loginAndLoadWorkspace(token)
324-
} catch (e: AuthenticationResponseException) {
325-
// probably the token is expired
326-
askTokenAndOpenSession()
324+
} catch (e: Exception) {
325+
when (e) {
326+
is AuthenticationResponseException -> {
327+
// probably the token is expired
328+
askTokenAndOpenSession()
329+
}
330+
331+
else -> {
332+
logger.warn("An exception was encountered while opening ${localWizardModel.coderURL}. Reasons: ${e.message}")
333+
localWizardModel = CoderWorkspacesWizardModel()
334+
tfUrl?.text = localWizardModel.coderURL
335+
}
336+
}
337+
327338
}
328339
}
329340
}

0 commit comments

Comments
 (0)