Skip to content

Commit a750117

Browse files
authored
Merge branch 'release/v1.22' into backport-misc
2 parents 5218b78 + 26437a0 commit a750117

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/auth/oauth2.go

Lines changed: 3 additions & 0 deletions
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)