Skip to content

Commit

Permalink
Splitted error.
Browse files Browse the repository at this point in the history
  • Loading branch information
KN4CK3R committed Jun 13, 2021
1 parent 75590a8 commit 3b24a41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion routers/web/user/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,16 @@ func newAccessTokenResponse(grant *models.OAuth2Grant, clientSecret string) (*Ac
}
err = app.LoadUser()
if err != nil {
if models.IsErrUserNotExist(err) {
return nil, &AccessTokenError{
ErrorCode: AccessTokenErrorCodeInvalidRequest,
ErrorDescription: "cannot find user",
}
}
log.Error("Error loading user: %v", err)
return nil, &AccessTokenError{
ErrorCode: AccessTokenErrorCodeInvalidRequest,
ErrorDescription: "cannot find user",
ErrorDescription: "server error",
}
}

Expand Down

0 comments on commit 3b24a41

Please sign in to comment.