Skip to content

Commit d90bcf1

Browse files
committed
if discord_use_ids is set make sure discord is the provider
1 parent 9c73ef9 commit d90bcf1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/cfg/oauth.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ func oauthBasicTest() error {
146146
case GenOAuth.Provider != Providers.Google && GenOAuth.Provider != Providers.IndieAuth && GenOAuth.Provider != Providers.HomeAssistant && GenOAuth.Provider != Providers.ADFS && GenOAuth.Provider != Providers.Azure && GenOAuth.UserInfoURL == "":
147147
// everyone except IndieAuth, Google and ADFS has an userInfoURL, and Azure does not actively use it
148148
return errors.New("configuration error: oauth.user_info_url not found")
149+
case GenOAuth.Provider != Providers.Discord && GenOAuth.DiscordUseIDs:
150+
return errors.New("configuration error: discord_use_ids is true but oauth.provider is not 'discord'")
149151
case GenOAuth.CodeChallengeMethod != "" && (GenOAuth.CodeChallengeMethod != "plain" && GenOAuth.CodeChallengeMethod != "S256"):
150152
return errors.New("configuration error: oauth.code_challenge_method must be either 'S256' or 'plain'")
151153
case GenOAuth.Provider == Providers.Azure || GenOAuth.Provider == Providers.ADFS || GenOAuth.Provider == Providers.Nextcloud || GenOAuth.Provider == Providers.OIDC:

0 commit comments

Comments
 (0)