Skip to content

Commit aebc808

Browse files
committed
Display root sign-in for multi-session mode with tasks
1 parent 90b2f72 commit aebc808

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/clerk-js/src/ui/common/withRedirect.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ export const withRedirectToSignInTask = <P extends AvailableComponentProps>(Comp
9999

100100
return withRedirect(
101101
Component,
102-
clerk => Boolean(clerk.session?.currentTask && signInCtx?.taskUrl),
102+
(clerk, environment) =>
103+
!!environment?.authConfig.singleSessionMode && !!(clerk.session?.currentTask && signInCtx?.taskUrl),
103104
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
104105
() => signInCtx.taskUrl!,
105106
undefined,
@@ -120,7 +121,8 @@ export const withRedirectToSignUpTask = <P extends AvailableComponentProps>(Comp
120121

121122
return withRedirect(
122123
Component,
123-
clerk => Boolean(clerk.session?.currentTask && signUpCtx?.taskUrl),
124+
(clerk, environment) =>
125+
!!environment?.authConfig.singleSessionMode && !!(clerk.session?.currentTask && signUpCtx?.taskUrl),
124126
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
125127
() => signUpCtx.taskUrl!,
126128
undefined,

0 commit comments

Comments
 (0)