diff --git a/shared/studio/tabs/auth/providers.tsx b/shared/studio/tabs/auth/providers.tsx index e38a5683..0cd0748c 100644 --- a/shared/studio/tabs/auth/providers.tsx +++ b/shared/studio/tabs/auth/providers.tsx @@ -323,6 +323,33 @@ const DraftProviderConfigForm = observer(function DraftProviderConfigForm({ onChange={(e) => draftState.setAdditionalScope(e.target.value)} /> + {draftState.selectedProviderType === + "ext::auth::DiscordOAuthProvider" ? ( + <> +
+ + Always show consent form + + Whether the user is shown a consent form from the provider. + Disabling this will still show the form when the user is new + or when the requested scopes have been changed. + + } + /> + + } + checked={draftState.alwaysShowConsentForm} + onChange={(checked) => + draftState.setAlwaysShowConsentForm(checked) + } + /> +
+ + ) : null} ) : providerKind === "Local" ? ( <> diff --git a/shared/studio/tabs/auth/state/index.tsx b/shared/studio/tabs/auth/state/index.tsx index 1c64a862..c1dda53f 100644 --- a/shared/studio/tabs/auth/state/index.tsx +++ b/shared/studio/tabs/auth/state/index.tsx @@ -1277,6 +1277,7 @@ export class DraftProviderConfig extends Model({ oauthClientId: prop(null).withSetter(), oauthSecret: prop(null).withSetter(), additionalScope: prop("").withSetter(), + alwaysShowConsentForm: prop(true).withSetter(), providerName: prop(null).withSetter(), displayName: prop(null).withSetter(), @@ -1462,6 +1463,13 @@ export class DraftProviderConfig extends Model({ `display_name := ${JSON.stringify(this.displayName!.trim())}`, `issuer_url := ${JSON.stringify(this.issuerUrl!.trim())}` ); + if (this.selectedProviderType === "ext::auth::DiscordOAuthProvider") { + queryFields.push( + `always_show_consent_form := ${ + this.alwaysShowConsentForm ? "true" : "false" + }` + ); + }; if (this.logoUrl.trim()) { queryFields.push( `logo_url := ${JSON.stringify(this.logoUrl!.trim())}`