fix: check oauth2 user id

This commit is contained in:
Jason Song 2022-12-29 17:33:47 +08:00
parent a145ec2f2b
commit 3db95bfbad
No known key found for this signature in database
GPG Key ID: 8402EEEE4511A8B5

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)