-
Notifications
You must be signed in to change notification settings - Fork 403
feat(nextjs,astro,backend): Redirect to tasks on auth.protect and auth.redirectToSignIn
#5440
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 2028869 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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.protectauth.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.redirectToSignInauth.protect and auth.redirectToSignIn
4c25a67 to
5020678
Compare
df2b744 to
eeafcc5
Compare
eeafcc5 to
a103ab9
Compare
auth.protect and auth.redirectToSignInauth.protect and auth.redirectToSignIn
710c402 to
611c61f
Compare
Introduce unit tests
611c61f to
fe44cc4
Compare
fe44cc4 to
2028869
Compare
brkalow
approved these changes
Apr 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Resolves ORGS-582
If
clerkMiddlewareexecutesauth.protect(), by default it'll look for thestson session claims and redirect to tasks.The index path on
SessionTasksperforms 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-organizationsince it only has thestsJWT claim.It verifies if
stsispending, and if so, navigates to/sign-in/tasks. Once clerk-js loads, it verifies for theClerk.session.currentTaskand performs a further client-side navigation to the specific task route.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change