1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-25 19:58:36 +00:00

fix: check oauth2 user id

This commit is contained in:
Jason Song
2022-12-29 17:33:47 +08:00
parent a145ec2f2b
commit 3db95bfbad

View File

@@ -126,7 +126,8 @@ func (o *OAuth2) Verify(req *http.Request, w http.ResponseWriter, store DataStor
}
id := o.userIDFromToken(req, store)
if id == -1 || id <= -3 { // -2 means actions, so we need to allow it.
if id <= 0 && id != -2 { // -2 means actions, so we need to allow it.
return nil, nil
}
log.Trace("OAuth2 Authorization: Found token for user[%d]", id)