Skip to content

mocactl login: say how long the device code is valid, and handle expired_token #431

Closed

Description

@pdettori

Seen in the OpenShift acceptance run (#423): two device codes expired while the user was away from the browser.

Today: mocactl login prints Open https://github.com/login/device and enter the code XXXX-XXXX, then fails with github device authorization failed: expired_token once GitHub's device code expires.

Proposal:

  • Print how long the code is valid, from expires_in in the device-code response.
  • On expired_token, re-issue a code once and print the new one, or say clearly "the code expired, run mocactl login again".
  • Applies to packages/mocactl (and to the control plane's /v1/auth/device relay, if it drops expires_in).
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions