Skip to content

Commit d86433c

Browse files
authored
Don't init singing keys if oauth2 provider disabled (#32177)
Backport #32148
1 parent 85897f9 commit d86433c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

services/auth/source/oauth2/init.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ const ProviderHeaderKey = "gitea-oauth2-provider"
3030

3131
// Init initializes the oauth source
3232
func Init(ctx context.Context) error {
33-
if err := InitSigningKey(); err != nil {
34-
return err
33+
// this is for oauth2 provider
34+
if setting.OAuth2.Enabled {
35+
if err := InitSigningKey(); err != nil {
36+
return err
37+
}
3538
}
3639

40+
// others for oauth2 clients
3741
// Lock our mutex
3842
gothRWMutex.Lock()
3943

0 commit comments

Comments
 (0)