Commit 25df5d9
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 generated1 parent 35f4ef9 commit 25df5d9
File tree
2 files changed
+5
-0
lines changed- src/main/kotlin/com/coder/gateway/cli
2 files changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
| |||
0 commit comments