Skip to content

fix(auth login): use token when logging in

Jay McCure requested to merge jmc-fix-login into main

Description

glab auth login is currently not setting the token from the token prompt. This results in a 401 for every initial login which means no config is set up for a user.

Steps to see the error:

  1. Delete entry for gitlab.com in ~/.config/glab-cli/config.yml
  2. glab auth login
  3. >gitlab.com
  4. >Token
  5. Paste valid token
  6. >ssh
error using api: GET https://gitlab.com/api/v4/user: 401 {message: 401 Unauthorized}

Also occurs for self-managed log ins. This was discovered while debugging #1175 (comment 1385571395)

How has this been tested?

Delete entry for gitlab.com in ~/.config/glab-cli/config.yml

glab auth login

✓ Logged in as jay_mccure (previously this would return a 401)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Jay McCure

Merge request reports