Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions shared/studio/tabs/auth/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,33 @@ const DraftProviderConfigForm = observer(function DraftProviderConfigForm({
onChange={(e) => draftState.setAdditionalScope(e.target.value)}
/>
</div>
{draftState.selectedProviderType ===
"ext::auth::DiscordOAuthProvider" ? (
<>
<div className={styles.formRow}>
<Checkbox
label={
<>
Always show consent form
<InfoTooltip
message={
<>
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)
}
/>
</div>
</>
) : null}
</>
) : providerKind === "Local" ? (
<>
Expand Down
8 changes: 8 additions & 0 deletions shared/studio/tabs/auth/state/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,7 @@ export class DraftProviderConfig extends Model({
oauthClientId: prop<string | null>(null).withSetter(),
oauthSecret: prop<string | null>(null).withSetter(),
additionalScope: prop("").withSetter(),
alwaysShowConsentForm: prop(true).withSetter(),

providerName: prop<string | null>(null).withSetter(),
displayName: prop<string | null>(null).withSetter(),
Expand Down Expand Up @@ -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())}`
Expand Down
Loading