fix cannot start when oauth2 provider not set

This commit is contained in:
MaysWind
2025-10-21 21:32:59 +08:00
parent 53a8ad71c6
commit af56c3057c
+4 -2
View File
@@ -91,7 +91,7 @@ const (
OAuth2UserIdentifierUsername string = "username"
)
// OAuth 2.0 rovider types
// OAuth 2.0 provider types
const (
OAuth2ProviderNextcloud string = "nextcloud"
)
@@ -998,7 +998,9 @@ func loadAuthConfiguration(config *Config, configFile *ini.File, sectionName str
oauth2Provider := getConfigItemStringValue(configFile, sectionName, "oauth2_provider")
if oauth2Provider == OAuth2ProviderNextcloud {
if oauth2Provider == "" {
config.OAuth2Provider = ""
} else if oauth2Provider == OAuth2ProviderNextcloud {
config.OAuth2Provider = OAuth2ProviderNextcloud
} else {
return errs.ErrInvalidOAuth2Provider