Skip to content

Commit 25df5d9

Browse files
committed
fix: don't create new api keys each time we do workspace polling
The default behavior for `coder login --token <token>` is to: - use the provided token temporarily to authenticate the login process - generate a new session token and stores that for future CLI use - the original token provided is not stored or reused The Coder `Recent projects` view polls every 5 seconds for workspaces from multiple Coder deployment. The polling process also involves a call to the `cli.login`. The cli is later used start workspaces if user clicks on a project for which the workspace is stopped. Instead of generating a new token each time we login we can use the `coder login --use-token-as-session --token <token>` which: - uses the provided token directly as the session token - stores the original token for future CLI commands - no new token is generated
1 parent 35f4ef9 commit 25df5d9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

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

55
## Unreleased
66

7+
### Fixed
8+
9+
- api keys are no longer created each time workspaces are polled
10+
711
## 2.22.1 - 2025-07-30
812

913
### Added

src/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ class CoderCLIManager(
288288
return exec(
289289
"login",
290290
deploymentURL.toString(),
291+
"--use-token-as-session",
291292
"--token",
292293
token,
293294
"--global-config",

0 commit comments

Comments
 (0)