Skip to content

Interactive token refresh

Problem to solve

Token refresh gives no immediate course of action,

❯ glab repo create "foobar"
GET https://gitlab.acme.net/api/v4/user: 401 {error: invalid_token}, {error_description: Token is expired. You can either do re-authorization or token refresh.}

This leaves the user to have to connect the dots, and requires the user to know that they must re-glab auth login.

Proposal

When the token has expired, rather than showing you the error as a JSON response, the cli should instead tell you the token has expired, and give you the address to create a new token using the same mechanism you used to create the original token.

It would be nice if glab kept a database of what perms the token had, so on expiry you could always recreate with the same perms rather than assuming only api and write_repository

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information