Skip to content

fix(cli): fix coder login token failing without --url flag#22742

Draft
zedkipp wants to merge 1 commit intomainfrom
zedkipp/login-token-url
Draft

fix(cli): fix coder login token failing without --url flag#22742
zedkipp wants to merge 1 commit intomainfrom
zedkipp/login-token-url

Conversation

@zedkipp
Copy link
Contributor

@zedkipp zedkipp commented Mar 7, 2026

coder login token didn't load the server URL from config, so it always required --url or CODER_URL when using the keyring. This command would only print out the token when already logged in to a deployment and file storage is used to store the session token (keyring is the default on Windows/macOS). It would also print out an incorrect token when --url was specified and the session token stored on disk was for a different deployment that the user logged into.

Also error when using the file backend with a --url that doesn't match the stored config URL, since the file backend only stores one token and would silently return the wrong one.

#22733

`coder login token` didn't load the server URL from config, so it
always required --url or CODER_URL when using the keyring. This command
would only print out the token when already logged in to a deployment
and file storage is used to store the session token (keyring is the
default on Windows/macOS). It would also print out an incorrect token
when --url was specified and the session token stored on disk was for
a different deployment that the user logged into.

Also error when using the file backend with a --url that doesn't
match the stored config URL, since the file backend only stores one
token and would silently return the wrong one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant