Skip to content

Commit b4eeb24

Browse files
committed
Update incorrect existing token label
This changed to automatically use the token, no confirmation.
1 parent 9aba12d commit b4eeb24

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/main/kotlin/com/coder/gateway/CoderRemoteConnectionHandle.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,16 @@ class CoderRemoteConnectionHandle {
179179
}
180180

181181
/**
182-
* Open a dialog for providing the token. Show any existing token so the
183-
* user can validate it if a previous connection failed. If we are not
184-
* retrying and the user has not checked the existing token box then open a
185-
* browser to the auth page. If the user has checked the existing token box
186-
* then populate the dialog with the token on disk (this will overwrite any
182+
* Open a dialog for providing the token. Show any existing token so
183+
* the user can validate it if a previous connection failed.
184+
*
185+
* If we are not retrying and the user has not checked the existing
186+
* token box then also open a browser to the auth page.
187+
*
188+
* If the user has checked the existing token box then return the token
189+
* on disk immediately and skip the dialog (this will overwrite any
187190
* other existing token) unless this is a retry to avoid clobbering the
188-
* token that just failed. Return the token submitted by the user.
191+
* token that just failed.
189192
*/
190193
@JvmStatic
191194
fun askToken(

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ class CoderWorkspacesStepView(val setNextButtonEnabled: (Boolean) -> Unit) : Cod
453453
tfUrlComment?.text = CoderGatewayBundle.message("gateway.connector.view.coder.workspaces.connect.text.connected", deploymentURL.host)
454454
} catch (e: Exception) {
455455
if (isCancellation(e)) {
456+
tfUrlComment?.text = CoderGatewayBundle.message("gateway.connector.view.coder.workspaces.connect.text.comment",
457+
CoderGatewayBundle.message("gateway.connector.view.coder.workspaces.connect.text"))
456458
tableOfWorkspaces.setEmptyState(CoderGatewayBundle.message(
457459
"gateway.connector.view.workspaces.connect.canceled",
458460
deploymentURL.host,

src/main/resources/messages/CoderGatewayBundle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ gateway.connector.action.text=Connect to Coder
44
gateway.connector.view.login.documentation.action=Learn more about Coder
55
gateway.connector.view.login.url.label=URL:
66
gateway.connector.view.login.existing-token.label=Use existing token
7-
gateway.connector.view.login.existing-token.tooltip=Checking "{0}" will prevent the browser from being launched for generating a new token after pressing "{1}". Additionally, if a token is already configured for this URL via the CLI it will appear as the default and can be used as-is or replaced.
7+
gateway.connector.view.login.existing-token.tooltip=Checking "{0}" will prevent the browser from being launched for generating a new token after pressing "{1}". Additionally, if a token is already configured for this URL via the CLI it will automatically be used.
88
gateway.connector.view.login.token.dialog=Paste your token here:
99
gateway.connector.view.login.token.label=Session Token:
1010
gateway.connector.view.coder.workspaces.header.text=Coder Workspaces

0 commit comments

Comments
 (0)