Skip to content
Snippets Groups Projects
Unverified Commit f3a7b2c7 authored by Tulir Asokan's avatar Tulir Asokan :cat2: Committed by GitHub
Browse files

Check error before response when logging in

parent 50d12957
No related branches found
No related tags found
No related merge requests found
......@@ -50,10 +50,10 @@ func loginGitlab(userID, token string) string {
}
user, resp, err := git.Users.CurrentUser()
if resp.StatusCode == 401 {
return fmt.Sprintf("Invalid access token!")
} else if err != nil {
if err != nil {
return fmt.Sprintf("GitLab login failed: %s", err)
} else if resp.StatusCode == 401 {
return fmt.Sprintf("Invalid access token!")
}
gitlabTokens[userID] = token
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment