Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clerk-js,clerk-react,types): Navigate to tasks on after sign-in/sign-up #5280

Merged
merged 16 commits into from
Mar 12, 2025

Conversation

LauraBeatris
Copy link
Member

@LauraBeatris LauraBeatris commented Mar 4, 2025

Description

Introduces navigation to tasks after sign-in/sign-up for UI components and custom flows:

CleanShot.2025-03-06.at.19.33.15-converted.mp4

Developer flow

It doesn't require changes on the setActive signature, since the navigation is triggered within Clerk once the session transitions to pending

What's next:

  • Introduce a Clerk.load option (tasksUrl) for resolving URLs for tasks on custom flows
  • Handle redirection after resolving tasks

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@LauraBeatris LauraBeatris self-assigned this Mar 4, 2025
Copy link

changeset-bot bot commented Mar 4, 2025

🦋 Changeset detected

Latest commit: b10bf3f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@clerk/clerk-js Minor
@clerk/types Minor
@clerk/clerk-react Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/shared Patch
@clerk/tanstack-start Patch
@clerk/testing Patch
@clerk/themes Patch
@clerk/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Mar 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 12, 2025 10:05pm

@LauraBeatris LauraBeatris changed the title feat(clerk-js): Navigate to tasks within SignIn/SignUp component [WIP] feat(clerk-js): Navigate to tasks within SignIn/SignUp component Mar 4, 2025
@LauraBeatris LauraBeatris changed the title [WIP] feat(clerk-js): Navigate to tasks within SignIn/SignUp component [WIP] feat(clerk-js): Navigate to tasks on after-auth Mar 5, 2025
@LauraBeatris LauraBeatris changed the title [WIP] feat(clerk-js): Navigate to tasks on after-auth [WIP] feat(clerk-js): Navigate to tasks on after sign-in/sign-up Mar 5, 2025
@LauraBeatris LauraBeatris changed the title feat(clerk-js,types): Navigate to tasks on after sign-in/sign-up feat(clerk-js,react,types): Navigate to tasks on after sign-in/sign-up Mar 12, 2025
@LauraBeatris LauraBeatris changed the title feat(clerk-js,react,types): Navigate to tasks on after sign-in/sign-up feat(clerk-js,clerk-react,types): Navigate to tasks on after sign-in/sign-up Mar 12, 2025
@LauraBeatris LauraBeatris requested a review from brkalow March 12, 2025 17:50
Copy link
Member

@panteliselef panteliselef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to 🚢 Some minor comments are

  • Update changeset to include @clerk/clerk-react
  • Avoid logging for <SignIn/> being unable to render when user can access '/sign-in/add-organization'

@LauraBeatris
Copy link
Member Author

I'm currently doing more tests on SSO callbacks + combined flows that trigger setActive with a pending session. Once @panteliselef gets addressed, then I'll proceed with merging.

@LauraBeatris
Copy link
Member Author

Regarding the SSO callback flow -> It navigates to task when FAPI redirects to /sso-callback since it calls setActive with the pending session

However, it's not working if the sign-in is already created on FAPI, and it's redirecting to the redirectUrlComplete which doesn't trigger the navigation

There are two ways to approach (in a next PR):

  • We trigger the navigation once the client gets updated -> find some way to react to this instead of relying on setActive
  • FAPI navigates to /sso-callback or a new route such as /sign-in/task-callback

@LauraBeatris LauraBeatris merged commit 725918d into main Mar 12, 2025
30 checks passed
@LauraBeatris LauraBeatris deleted the laura/after-auth-1 branch March 12, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants