Skip to content

Commit e313f45

Browse files
authored
fix: go to previous step when connection fails (#77)
- happens when an error is encountered during connection (like exceptions caused by an expired token) - right now the auth wizard stays on the last step. - with this changeset the auth steps reset to the initial sign in for auto-connect, or it goes back one step back to the token input step for manual authentication
1 parent a509615 commit e313f45

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
- action buttons on the token input step were swapped to achieve better keyboard navigation
1212

13+
### Fixed
14+
15+
- authorization wizard automatically goes to a previous screen when an error is encountered during connection to Coder deployment
16+
1317
## 0.1.3 - 2025-04-09
1418

1519
### Fixed

src/main/kotlin/com/coder/toolbox/views/AuthWizardPage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AuthWizardPage(
2222

2323
private val signInStep = SignInStep(context)
2424
private val tokenStep = TokenStep(context)
25-
private val connectStep = ConnectStep(context, shouldAutoLogin, this::notify, onConnect)
25+
private val connectStep = ConnectStep(context, shouldAutoLogin, this::notify, this::displaySteps, onConnect)
2626

2727

2828
/**

src/main/kotlin/com/coder/toolbox/views/ConnectStep.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class ConnectStep(
2727
private val context: CoderToolboxContext,
2828
private val shouldAutoLogin: StateFlow<Boolean>,
2929
private val notify: (String, Throwable) -> Unit,
30+
private val refreshWizard: () -> Unit,
3031
private val onConnect: (
3132
client: CoderRestClient,
3233
cli: CoderCLIManager,
@@ -102,9 +103,13 @@ class ConnectStep(
102103
} catch (ex: CancellationException) {
103104
if (ex.message != USER_HIT_THE_BACK_BUTTON) {
104105
notify("Connection to ${url.host} was configured", ex)
106+
onBack()
107+
refreshWizard()
105108
}
106109
} catch (ex: Exception) {
107110
notify("Failed to configure ${url.host}", ex)
111+
onBack()
112+
refreshWizard()
108113
}
109114
}
110115
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy