You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
login: refresh an existing credential for the same user instead of failing #48
voltage login refuses to run when a credential with the same account name is already saved:
$ ./scripts/voltage-staging login
Open <auth-url>/cli/authorize?user_code=XXXX-XXXX
Confirm this code: XXXX-XXXX
error: Credential <email> already exists; log it out first or use a different --account name
Two problems:
The check runs after the browser flow starts. The user opens the URL and confirms the code, and only then gets the error.
Signing in again as the same user is a normal action, for example after a token expires or to switch scopes. The error tells the user to log out first, which revokes the old login and adds a step.
The error comes from src/auth.rs (around line 556).
Expected behavior
When the new login is for the same user as the saved credential, replace the stored credential and report that it was refreshed.
When the new login is for a different user under that account name, keep the error, but report it before the device-code prompt so the browser step is not wasted.
Revoke the replaced refresh token, or document why it is kept.
Notes
voltage auth status reported this credential as expired: true, yet requests with --account still succeeded because the refresh token was valid. The user had no reason to log in again; a hint toward --account (see #47) would have avoided the attempt.
Activity
feat(cli): replace a saved login when the same user signs in again
feat(cli): replace a saved login when the same user signs in again
feat(cli): replace a saved login when the same user signs in again (#67)