feat(nextjs,astro,backend): Redirect to tasks on auth.protect and auth.redirectToSignIn - #5440
Merged
Conversation
|
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 |
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 24, 2025 00:12
cc1d782 to
6916509
Compare
auth.protectauth.protect()
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 24, 2025 00:17
53870e2 to
c4d287d
Compare
auth.protect()auth.protect()
LauraBeatris
marked this pull request as ready for review
March 24, 2025 00:23
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 24, 2025 00:26
c4d287d to
1dcecd5
Compare
LauraBeatris
force-pushed
the
laura/lazy-load-tasks-env
branch
4 times, most recently
from
March 24, 2025 11:55
79831ab to
4dde647
Compare
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 24, 2025 12:07
1dcecd5 to
d74efe3
Compare
auth.protect()auth.protect and auth.redirectToSignIn
auth.protect and auth.redirectToSignInauth.protect and auth.redirectToSignIn
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 24, 2025 19:35
4c25a67 to
5020678
Compare
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 28, 2025 15:28
55f6d99 to
cec4424
Compare
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 28, 2025 15:39
cec4424 to
d42ba62
Compare
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 28, 2025 15:55
d42ba62 to
ac41b1f
Compare
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
2 times, most recently
from
March 28, 2025 16:15
d0ad572 to
2aaa471
Compare
LauraBeatris
marked this pull request as ready for review
March 28, 2025 16:15
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
2 times, most recently
from
March 28, 2025 16:36
69e600d to
df2b744
Compare
LauraBeatris
force-pushed
the
laura/auth-protect-for-tasks
branch
from
March 28, 2025 16:38
df2b744 to
eeafcc5
Compare
Introduce unit tests
brkalow
approved these changes
Apr 3, 2025
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
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