Unable to use glab due to "oauth2: "invalid_grant"" with fresh api scoped token

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: glab 1.64.0 (fe60bcf7)
  • Operating system and version: MacOS 15.5 (24F74)
  • Gitlab.com or self-managed instance? gitlab.com
  • GitLab version (if self-managed) n/a (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues
  • Run the command in debug mode (like DEBUG=true glab mr list) and attach any useful output
$ DEBUG=true glab api user
[git remote -v]
[git config --get-regexp ^remote\..*\.glab-resolved$]
2025/07/24 16:28:59 Could not parse telemetry config value  - defaulting to 'true'
[git remote -v]
[git config --get-regexp ^remote\..*\.glab-resolved$]
ERROR: oauth2: "invalid_grant" "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."

Summary

Glab auth is failing

Environment

  • OS: Darwin 24.5.0 arm64
  • SHELL: /bin/zsh
  • TERM: xterm-256color
  • GLAB: glab 1.64.0 (fe60bcf7)

Other: This was working just yesterday, and today it's started erroring. I may have upgraded the tool yesterday, but I also just upgraded it from 1.63.0 to 1.64.0 when I saw the error the first time, so it's affecting both these versions.

Steps to reproduce

  1. Set the GITLAB_TOKEN env var to you API token (scoped to api);
  2. Run $ glab api user;
  3. See error!

What is the current bug behavior?

Any API call result in this error…

ERROR: oauth2: "invalid_grant" "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."

What is the expected correct behavior?

The API results would be displayed.

Relevant logs and/or screenshots

$ DEBUG=true glab auth status
[git remote -v]
[git config --get-regexp ^remote\..*\.glab-resolved$]
2025/07/24 16:30:55 Could not parse telemetry config value  - defaulting to 'true'
gitlab.com
  x gitlab.com: API call failed: oauth2: "invalid_grant" "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
  ✓ Git operations for gitlab.com configured to use ssh protocol.
  ✓ API calls for gitlab.com are made over https protocol.
  ✓ REST API Endpoint: https://gitlab.com/api/v4/
  ✓ GraphQL Endpoint: https://gitlab.com/api/graphql/
  ✓ Token: **************************

! One of GITLAB_TOKEN, GITLAB_ACCESS_TOKEN, OAUTH_TOKEN environment variables is set. It will be used for all authentication.
ERROR:
x could not authenticate to one or more of the configured GitLab instances.

Possible fixes