mirror of
https://github.com/go-gitea/gitea
synced 2025-01-09 09:24:25 +00:00
Partially backport Disable Oauth check if oauth disabled #32368
This commit is contained in:
parent
b48df1082e
commit
26437a03b0
@ -27,6 +27,9 @@ var (
|
|||||||
|
|
||||||
// CheckOAuthAccessToken returns uid of user from oauth token
|
// CheckOAuthAccessToken returns uid of user from oauth token
|
||||||
func CheckOAuthAccessToken(ctx context.Context, accessToken string) int64 {
|
func CheckOAuthAccessToken(ctx context.Context, accessToken string) int64 {
|
||||||
|
if !setting.OAuth2.Enabled {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
// JWT tokens require a "."
|
// JWT tokens require a "."
|
||||||
if !strings.Contains(accessToken, ".") {
|
if !strings.Contains(accessToken, ".") {
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user