glab repo clone using a full URL authenticates to gitlab.com
Checklist
-
I'm using the latest version of the extension (Run glab --version) -
Gitlab.com or self-managed instance? both -
I have performed glab auth statusto check for authentication issues
Summary
Steps to reproduce
Set an incorrect/empty token for the gitlab.com host entry in ~/.config/glab-cli/config.yml
Set host to gitlab.com in ~/.config/glab-cli/config.yml or remove host as it will default to gitlab.com
glab repo clone https://mygitlab.com/mygroup/myrepo
What is the current bug behavior?
GET https://gitlab.com/api/v4/user: 401 {message: 401 Unauthorized}
What is the expected correct behavior?
repo is cloned similar to:
GITLAB_HOST=mygitlab.com glab repo clone https://mygitlab.com/mygroup/myrepo
Workaround
Set host to your desired env in ~/.config/glab-cli/config.yml
Edited by Jay McCure