Browse Source

Don't init singing keys if oauth2 provider disabled (#32177)

Backport #32148
pull/32188/head
Lunny Xiao 1 year ago committed by GitHub
parent
commit
d86433cce2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      services/auth/source/oauth2/init.go

8
services/auth/source/oauth2/init.go

@ -30,10 +30,14 @@ const ProviderHeaderKey = "gitea-oauth2-provider" @@ -30,10 +30,14 @@ const ProviderHeaderKey = "gitea-oauth2-provider"
// Init initializes the oauth source
func Init(ctx context.Context) error {
if err := InitSigningKey(); err != nil {
return err
// this is for oauth2 provider
if setting.OAuth2.Enabled {
if err := InitSigningKey(); err != nil {
return err
}
}
// others for oauth2 clients
// Lock our mutex
gothRWMutex.Lock()

Loading…
Cancel
Save