Skip to content

Commit 26437a0

Browse files
authored
Disable Oauth check if oauth disabled (#32368) (#32480)
Partially backport Disable Oauth check if oauth disabled #32368
1 parent b48df10 commit 26437a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/auth/oauth2.go

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ var (
2727

2828
// CheckOAuthAccessToken returns uid of user from oauth token
2929
func CheckOAuthAccessToken(ctx context.Context, accessToken string) int64 {
30+
if !setting.OAuth2.Enabled {
31+
return 0
32+
}
3033
// JWT tokens require a "."
3134
if !strings.Contains(accessToken, ".") {
3235
return 0

0 commit comments

Comments
 (0)