-
Notifications
You must be signed in to change notification settings - Fork 327
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(nextjs,astro,backend,types): Redirect to tasks on auth.protect
and auth.redirectToSignIn
#5440
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 5dca566 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
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 |
cc1d782
to
6916509
Compare
auth.protect
auth.protect()
53870e2
to
c4d287d
Compare
auth.protect()
auth.protect()
c4d287d
to
1dcecd5
Compare
79831ab
to
4dde647
Compare
1dcecd5
to
d74efe3
Compare
auth.protect()
auth.protect
and auth.redirectToSignIn
auth.protect
and auth.redirectToSignIn
auth.protect
and auth.redirectToSignIn
4c25a67
to
5020678
Compare
4dde647
to
6e7d003
Compare
256ab4d
to
da61a18
Compare
da61a18
to
0ffc6da
Compare
0ffc6da
to
b63b291
Compare
8fe31c4
to
a243611
Compare
FYI - I'm currently introducing unit tests for tasks redirection on While I'm refactoring, some integration tests might start to fail here as well - I'll ping another review |
a243611
to
5dca566
Compare
Description
Resolves ORGS-582
If
clerkMiddleware
executesauth.protect()
, by default it'll look for thests
on session claims and redirect to tasks.The index path on
SessionTasks
performs a reload on the client session, to resolve the missing task resource and then proceeds redirecting to the next component route.Behavior
CleanShot.2025-03-24.at.14.23.16.mp4
Inner workings
The server cannot redirect directly to the specific task URL, eg:
/sign-in/tasks/add-organization
since it only has thests
JWT claim.It verifies if
sts
ispending
, and if so, navigates to/sign-in/tasks
. Once clerk-js loads, it verifies for theClerk.session.currentTask
and performs a further client-side navigation to the specific task route.Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change