glab auth via web not authenticating properly

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: Put your extension version here
  • Operating system and version: Put your version here
  • Gitlab.com or self-managed instance? gitlab.com/self-managed instance/both
  • GitLab version (if self-managed) GitLab version here (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues

Summary

I ran glab auth web and successfully authenticated via the web but cannot run glab repo view --web from within a gitlab repo. The error is:

x `repository` is required when not running in a git repository error=1 error occurred:
	* gitlab-org/gitlab: GET https://gitlab.com/api/v4/projects/gitlab-org/gitlab: 401 {error: invalid_token}, {error_description: Token is expired. You can either do re-authorization or token refresh.}

The output of glab auth status:

glab auth status
gitlab.com
  x gitlab.com: api call failed: GET https://gitlab.com/api/v4/user: 401 {error: invalid_token}, {error_description: Token is expired. You can either do re-authorization or token refresh.}
  ✓ 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: **************************
  ! Invalid token provided

Environment

- OS: Darwin 23.5.0 arm64
- SHELL: /bin/zsh
- TERM: xterm-256color
- GLAB: glab version 1.41.0 (2024-05-28

Other:

Steps to reproduce

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Possible fixes

Edited by Jessie Young