Browse Source

Disable Oauth check if oauth disabled (#32368) (#32480)

Partially backport Disable Oauth check if oauth disabled #32368
pull/32495/head
wxiaoguang 1 year ago committed by GitHub
parent
commit
26437a03b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      services/auth/oauth2.go

3
services/auth/oauth2.go

@ -27,6 +27,9 @@ var ( @@ -27,6 +27,9 @@ var (
// CheckOAuthAccessToken returns uid of user from oauth token
func CheckOAuthAccessToken(ctx context.Context, accessToken string) int64 {
if !setting.OAuth2.Enabled {
return 0
}
// JWT tokens require a "."
if !strings.Contains(accessToken, ".") {
return 0

Loading…
Cancel
Save