镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

login: refresh an existing credential for the same user instead of failing #48

Closed

Description

@thebrandonlucas

Problem

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:

  1. The check runs after the browser flow starts. The user opens the URL and confirms the code, and only then gets the error.
  2. 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

  1. added 3 commits that reference this issue on Oct 20, 2026
    be91ef5
    c66d2a3
    a25b69d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions