Skip to content

Commit

Permalink
Fix sign in router for enterprise_sso
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraBeatris committed Jan 16, 2025
1 parent 7cc0576 commit 941a14a
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const SignInRouterMachine = setup({
},
})),
},
'AUTHENTICATE.ENTERPRISE_SSO': {
'AUTHENTICATE.SAML': {
actions: sendTo(ThirdPartyMachineId, ({ context }) => ({
type: 'REDIRECT',
params: {
Expand All @@ -220,6 +220,22 @@ export const SignInRouterMachine = setup({
},
})),
},
'AUTHENTICATE.ENTERPRISE_SSO': {
actions: sendTo(ThirdPartyMachineId, ({ context }) => ({
type: 'REDIRECT',
params: {
strategy: 'enterprise_sso',
identifier: context.formRef.getSnapshot().context.fields.get('identifier')?.value,
redirectUrl: `${
context.router?.mode === ROUTING.virtual
? context.clerk.__unstable__environment?.displayConfig.signInUrl
: context.router?.basePath
}${SSO_CALLBACK_PATH_ROUTE}`,
redirectUrlComplete:
context.router?.searchParams().get('redirect_url') || context.clerk.buildAfterSignInUrl(),
},
})),
},
'FORM.ATTACH': {
description: 'Attach/re-attach the form to the router.',
actions: enqueueActions(({ enqueue, event }) => {
Expand Down

0 comments on commit 941a14a

Please sign in to comment.