Skip to content

Commit 3b24a41

Browse files
committed
Splitted error.
1 parent 75590a8 commit 3b24a41

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

routers/web/user/oauth.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,16 @@ func newAccessTokenResponse(grant *models.OAuth2Grant, clientSecret string) (*Ac
187187
}
188188
err = app.LoadUser()
189189
if err != nil {
190+
if models.IsErrUserNotExist(err) {
191+
return nil, &AccessTokenError{
192+
ErrorCode: AccessTokenErrorCodeInvalidRequest,
193+
ErrorDescription: "cannot find user",
194+
}
195+
}
196+
log.Error("Error loading user: %v", err)
190197
return nil, &AccessTokenError{
191198
ErrorCode: AccessTokenErrorCodeInvalidRequest,
192-
ErrorDescription: "cannot find user",
199+
ErrorDescription: "server error",
193200
}
194201
}
195202

0 commit comments

Comments
 (0)