Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f2a967

Browse files
committed
fix: don't store token when certificates are configured
This was a regression for the custom flows that required authentication via certificates, the http client and the coder cli were properly initialized but afterward the token was still required for storing. Note: the issue was hard to catch early on because the official coder cli is not supporting auth. via certificates.
1 parent f056813 commit 9f2a967

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

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

33
## Unreleased
44

5+
### Fixed
6+
7+
- token is no longer required when authentication is done via certificates
8+
59
## 0.6.4 - 2025-09-03
610

711
### Added

src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,13 @@ class CoderRemoteProvider(
396396
private fun onConnect(client: CoderRestClient, cli: CoderCLIManager) {
397397
// Store the URL and token for use next time.
398398
context.secrets.lastDeploymentURL = client.url.toString()
399-
context.secrets.lastToken = client.token ?: ""
400-
context.secrets.storeTokenFor(client.url, context.secrets.lastToken)
401-
context.logger.info("Deployment URL and token were stored and will be available for automatic connection")
399+
if (context.settingsStore.requireTokenAuth) {
400+
context.secrets.lastToken = client.token ?: ""
401+
context.secrets.storeTokenFor(client.url, context.secrets.lastToken)
402+
context.logger.info("Deployment URL and token were stored and will be available for automatic connection")
403+
} else {
404+
context.logger.info("Deployment URL was stored and will be available for automatic connection")
405+
}
402406
this.client = client
403407
pollJob?.let {
404408
it.cancel()

0 commit comments

Comments
 (0)