Don't init oauth if settings have it disabled

This commit is contained in:
techknowlogick 2024-07-01 12:35:02 -04:00
parent 3bd87fb170
commit b1d548b9f0

View File

@ -30,6 +30,11 @@ const ProviderHeaderKey = "gitea-oauth2-provider"
// Init initializes the oauth source
func Init(ctx context.Context) error {
// if oauth is disabled, we don't need to initialize anything
if !setting.OAuth2.Enable {
return
}
if err := InitSigningKey(); err != nil {
return err
}