1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

refactor(oauth): add debug logs

This commit is contained in:
Chaim Lev Ari 2018-12-30 18:25:30 +02:00
parent 241a701eca
commit 2ee6f2780b
2 changed files with 3 additions and 2 deletions

View file

@ -111,11 +111,13 @@ func (handler *Handler) authenticateOAuth(w http.ResponseWriter, r *http.Request
token, err := handler.OAuthService.GetAccessToken(payload.Code, &settings.OAuthSettings)
if err != nil {
log.Printf("[DEBUG] - Failed retrieving access token: %v", err)
return &httperror.HandlerError{http.StatusUnprocessableEntity, "Invalid access token", portainer.ErrUnauthorized}
}
username, err := handler.OAuthService.GetUsername(token, &settings.OAuthSettings)
if err != nil {
log.Printf("[DEBUG] - Failed acquiring username: %v", err)
return &httperror.HandlerError{http.StatusForbidden, "Unable to acquire username", portainer.ErrUnauthorized}
}