Skip to content

Commit

Permalink
feat: force OIDC account selection on settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas committed Nov 8, 2024
1 parent 0173d87 commit 62e1ed6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/elements-react/src/components/form/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,13 @@ export function OryForm({ children, onAfterSubmit, nodes }: OryFormProps) {
submitData.method = "lookup_secret"
}

if ("link" in submitData || "unlink" in submitData) {
submitData.method = "oidc"
// Force the account selection screen on link to provide a better use experience.
// https://github.com/ory/elements/issues/268
// TODO: Maybe this needs to be configurable in the configuration
if (submitData.method === "oidc") {
submitData.upstream_parameters = {
prompt: "select_account",
}
}

if ("webauthn_remove" in submitData) {
Expand Down

0 comments on commit 62e1ed6

Please sign in to comment.