From 9f478ca7eb156b0c88651d72b5a6771133178826 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 21 Oct 2025 09:32:31 -0600 Subject: [PATCH 1/7] Add initial info --- docs/manifest.json | 4 + .../components/control/redirect-to-tasks.mdx | 138 ++++++++++++++++++ docs/reference/components/overview.mdx | 1 + 3 files changed, 143 insertions(+) create mode 100644 docs/reference/components/control/redirect-to-tasks.mdx diff --git a/docs/manifest.json b/docs/manifest.json index 5dc70a3b78..56f7e37519 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -3202,6 +3202,10 @@ "title": "``", "href": "/docs/reference/components/control/redirect-to-sign-up" }, + { + "title": "``", + "href": "/docs/reference/components/control/redirect-to-tasks" + }, { "title": "``", "href": "/docs/reference/components/control/redirect-to-user-profile" diff --git a/docs/reference/components/control/redirect-to-tasks.mdx b/docs/reference/components/control/redirect-to-tasks.mdx new file mode 100644 index 0000000000..2efce3d413 --- /dev/null +++ b/docs/reference/components/control/redirect-to-tasks.mdx @@ -0,0 +1,138 @@ +--- +title: '``' +description: The component will navigate users to the appropriate task page when they have pending session tasks. +sdk: chrome-extension, nextjs, nuxt, react, react-router, remix,tanstack-react-start, vue +--- + +The `` component will navigate users to the appropriate task page when they have pending session tasks. + +## Example + + + ```tsx {{ filename: 'app/page.tsx' }} + import { SignedOut, RedirectToTasks } from '@clerk/nextjs' + + export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + + + + {children} + + ) + } + ``` + + + + ```tsx {{ filename: 'pages/index.tsx' }} + import { SignedOut, RedirectToTasks } from '@clerk/clerk-react' + + export default function Page() { + return ( + <> + + + + + ) + } + ``` + + + + ```tsx {{ filename: 'app/routes/home.tsx' }} + import { SignedIn, SignedOut, RedirectToTasks } from '@clerk/react-router' + + export default function Home() { + return ( + <> + + + + +

You need to sign in to view your user profile.

+
+ + ) + } + ``` +
+ + + ```tsx {{ filename: 'app/routes/_index.tsx' }} + import { SignedIn, SignedOut, RedirectToTasks } from '@clerk/remix' + + export default function Index() { + return ( +
+ + + + +

You need to sign in to view your user profile.

+
+
+ ) + } + ``` +
+ + + ```tsx {{ filename: 'app/routes/index.tsx' }} + import { SignedIn, SignedOut, RedirectToTasks } from '@clerk/tanstack-react-start' + import { createFileRoute } from '@tanstack/react-router' + + export const Route = createFileRoute('/')({ + component: Home, + }) + + function Home() { + return ( +
+ + + + +

You need to sign in to view your user profile.

+
+
+ ) + } + ``` +
+ + + ```vue {{ filename: 'App.vue' }} + + + + ``` + + + + ```vue {{ filename: 'App.vue' }} + + + + ``` + diff --git a/docs/reference/components/overview.mdx b/docs/reference/components/overview.mdx index 09261cf3b7..26ff1234df 100644 --- a/docs/reference/components/overview.mdx +++ b/docs/reference/components/overview.mdx @@ -40,6 +40,7 @@ Control components manage authentication-related behaviors in your application. - [``](/docs/reference/components/control/protect) - [``](/docs/reference/components/control/redirect-to-sign-in) - [``](/docs/reference/components/control/redirect-to-sign-up) +- [``](/docs/reference/components/control/redirect-to-tasks) - [``](/docs/reference/components/control/redirect-to-user-profile) - [``](/docs/reference/components/control/redirect-to-organization-profile) - [``](/docs/reference/components/control/redirect-to-create-organization) From 35d194832405f53e1bb54a17d27515fc0c1151b6 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 21 Oct 2025 14:02:08 -0600 Subject: [PATCH 2/7] Refine code examples --- .../components/control/redirect-to-tasks.mdx | 35 ++++++------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/docs/reference/components/control/redirect-to-tasks.mdx b/docs/reference/components/control/redirect-to-tasks.mdx index 2efce3d413..5e4093ccb6 100644 --- a/docs/reference/components/control/redirect-to-tasks.mdx +++ b/docs/reference/components/control/redirect-to-tasks.mdx @@ -1,7 +1,7 @@ --- title: '``' description: The component will navigate users to the appropriate task page when they have pending session tasks. -sdk: chrome-extension, nextjs, nuxt, react, react-router, remix,tanstack-react-start, vue +sdk: chrome-extension, nextjs, nuxt, react, react-router, remix, tanstack-react-start, vue --- The `` component will navigate users to the appropriate task page when they have pending session tasks. @@ -43,16 +43,13 @@ The `` component will navigate users to the appropriate task ```tsx {{ filename: 'app/routes/home.tsx' }} - import { SignedIn, SignedOut, RedirectToTasks } from '@clerk/react-router' + import { SignedOut, RedirectToTasks } from '@clerk/react-router' export default function Home() { return ( <> - - - -

You need to sign in to view your user profile.

+
) @@ -62,16 +59,13 @@ The `` component will navigate users to the appropriate task ```tsx {{ filename: 'app/routes/_index.tsx' }} - import { SignedIn, SignedOut, RedirectToTasks } from '@clerk/remix' + import { SignedOut, RedirectToTasks } from '@clerk/remix' export default function Index() { return (
- - - -

You need to sign in to view your user profile.

+
) @@ -81,7 +75,7 @@ The `` component will navigate users to the appropriate task ```tsx {{ filename: 'app/routes/index.tsx' }} - import { SignedIn, SignedOut, RedirectToTasks } from '@clerk/tanstack-react-start' + import { SignedOut, RedirectToTasks } from '@clerk/tanstack-react-start' import { createFileRoute } from '@tanstack/react-router' export const Route = createFileRoute('/')({ @@ -91,11 +85,8 @@ The `` component will navigate users to the appropriate task function Home() { return (
- - - -

You need to sign in to view your user profile.

+
) @@ -106,15 +97,12 @@ The `` component will navigate users to the appropriate task ```vue {{ filename: 'App.vue' }} ``` @@ -127,11 +115,8 @@ The `` component will navigate users to the appropriate task ``` From 5f5a54c52569ffa3f7d8cc7b2ccc45a5fed0458f Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 21 Oct 2025 14:05:35 -0600 Subject: [PATCH 3/7] Fix linting --- .../components/control/redirect-to-tasks.mdx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/reference/components/control/redirect-to-tasks.mdx b/docs/reference/components/control/redirect-to-tasks.mdx index 5e4093ccb6..8cdfdc7afa 100644 --- a/docs/reference/components/control/redirect-to-tasks.mdx +++ b/docs/reference/components/control/redirect-to-tasks.mdx @@ -10,18 +10,18 @@ The `` component will navigate users to the appropriate task ```tsx {{ filename: 'app/page.tsx' }} - import { SignedOut, RedirectToTasks } from '@clerk/nextjs' - - export default function Layout({ children }: { children: React.ReactNode }) { - return ( - <> - - - - {children} - - ) - } + import { SignedOut, RedirectToTasks } from '@clerk/nextjs' + + export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + + + + {children} + + ) + } ``` From 4a81a8498187d6779dfd6da00a7926e79dc8ba22 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Wed, 22 Oct 2025 12:43:08 -0600 Subject: [PATCH 4/7] Refine text + fix redirect create org description --- .../components/control/redirect-to-create-organization.mdx | 2 +- docs/reference/components/control/redirect-to-tasks.mdx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/reference/components/control/redirect-to-create-organization.mdx b/docs/reference/components/control/redirect-to-create-organization.mdx index f6032c01c5..411aff3b7d 100644 --- a/docs/reference/components/control/redirect-to-create-organization.mdx +++ b/docs/reference/components/control/redirect-to-create-organization.mdx @@ -1,6 +1,6 @@ --- title: '`` (deprecated)' -description: The component will navigate to the user profile URL which has been configured in your application instance. The behavior will be just like a server-side (3xx) redirect, and will override the current location in the history stack. +description: The component will navigate to the create organization flow which has been configured in your application instance. The behavior will be just like a server-side (3xx) redirect, and will override the current location in the history stack. sdk: nextjs, nuxt, react, react-router, remix, tanstack-react-start, vue --- diff --git a/docs/reference/components/control/redirect-to-tasks.mdx b/docs/reference/components/control/redirect-to-tasks.mdx index 8cdfdc7afa..01ee44c0a1 100644 --- a/docs/reference/components/control/redirect-to-tasks.mdx +++ b/docs/reference/components/control/redirect-to-tasks.mdx @@ -1,10 +1,11 @@ --- title: '``' -description: The component will navigate users to the appropriate task page when they have pending session tasks. +description: The component will navigate to the tasks flow which has been configured in your application instance when users have pending session tasks. The behavior will be just like a server-side (3xx) redirect, and will override the current location in the history stack. + sdk: chrome-extension, nextjs, nuxt, react, react-router, remix, tanstack-react-start, vue --- -The `` component will navigate users to the appropriate task page when they have pending session tasks. +The `` component will navigate to the tasks flow which has been configured in your application instance when users have pending session tasks. The behavior will be just like a server-side (3xx) redirect, and will override the current location in the history stack. [See the guide on creating custom pages for sessions tasks](/docs/guides/development/custom-flows/overview#session-tasks). ## Example From 3c4e803715d1833dba12667e30d5cf65d90626f6 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Wed, 22 Oct 2025 15:00:25 -0600 Subject: [PATCH 5/7] Update docs/reference/components/control/redirect-to-tasks.mdx Co-authored-by: Laura Beatris <48022589+LauraBeatris@users.noreply.github.com> --- docs/reference/components/control/redirect-to-tasks.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/components/control/redirect-to-tasks.mdx b/docs/reference/components/control/redirect-to-tasks.mdx index 01ee44c0a1..523b81011f 100644 --- a/docs/reference/components/control/redirect-to-tasks.mdx +++ b/docs/reference/components/control/redirect-to-tasks.mdx @@ -10,7 +10,7 @@ The `` component will navigate to the tasks flow which has be ## Example - ```tsx {{ filename: 'app/page.tsx' }} + ```tsx {{ filename: 'app/layout.tsx' }} import { SignedOut, RedirectToTasks } from '@clerk/nextjs' export default function Layout({ children }: { children: React.ReactNode }) { From ce47607a219e4bfa930d148679ed45b45a72f757 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Wed, 22 Oct 2025 15:01:35 -0600 Subject: [PATCH 6/7] Fix spacing --- docs/reference/components/control/redirect-to-tasks.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/reference/components/control/redirect-to-tasks.mdx b/docs/reference/components/control/redirect-to-tasks.mdx index 523b81011f..5b19a5a9e8 100644 --- a/docs/reference/components/control/redirect-to-tasks.mdx +++ b/docs/reference/components/control/redirect-to-tasks.mdx @@ -1,7 +1,6 @@ --- title: '``' description: The component will navigate to the tasks flow which has been configured in your application instance when users have pending session tasks. The behavior will be just like a server-side (3xx) redirect, and will override the current location in the history stack. - sdk: chrome-extension, nextjs, nuxt, react, react-router, remix, tanstack-react-start, vue --- From c7f6c6de0e941114b90a4bec24ff43286f9f5db2 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Thu, 23 Oct 2025 10:34:52 -0600 Subject: [PATCH 7/7] Add chrome extension example --- .../components/control/redirect-to-tasks.mdx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/reference/components/control/redirect-to-tasks.mdx b/docs/reference/components/control/redirect-to-tasks.mdx index 5b19a5a9e8..7b1558972b 100644 --- a/docs/reference/components/control/redirect-to-tasks.mdx +++ b/docs/reference/components/control/redirect-to-tasks.mdx @@ -57,6 +57,25 @@ The `` component will navigate to the tasks flow which has be ``` + + > [!NOTE] + > This component relies on React Router for navigation. Ensure that you have integrated React Router into your Chrome Extension application before using it. [Learn how to add React Router to your Chrome Extension](/docs/guides/development/add-react-router). + + ```jsx {{ filename: 'src/routes/home.tsx' }} + import { SignedOut, RedirectToTasks } from '@clerk/chrome-extension' + + export default function Home() { + return ( + <> + + + + + ) + } + ``` + + ```tsx {{ filename: 'app/routes/_index.tsx' }} import { SignedOut, RedirectToTasks } from '@clerk/remix'