feat(astro): Support auth().redirectToSignIn() at page level - #3711
Merged
panteliselef merged 3 commits intoJul 15, 2024
Merged
Conversation
🦋 Changeset detectedLatest commit: b8a3353 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
panteliselef
requested review from
LekoArts,
dimkl,
nikosdouvlis and
wobsoriano
and removed request for
dimkl
July 15, 2024 12:14
wobsoriano
reviewed
Jul 15, 2024
Comment on lines
+250
to
+251
| }).redirectToSignIn({ | ||
| returnBackUrl: opts.returnBackUrl === null ? '' : opts.returnBackUrl || clerkUrl.toString(), |
Member
There was a problem hiding this comment.
Does the redirectToSignUp function commonly used?
Contributor
Author
There was a problem hiding this comment.
We've build it, but no public API consumes it. and this implementation aims to mirror the API from @clerk/nextjs.
wobsoriano
approved these changes
Jul 15, 2024
wobsoriano
left a comment
Member
There was a problem hiding this comment.
Looks straightforward, just left a question 🚀
panteliselef
enabled auto-merge (squash)
July 15, 2024 15:58
panteliselef
deleted the
elef/eco-41-support-authredirecttosignin-at-page-level
branch
July 15, 2024 16:30
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
Support
Astro.locals.auth().redirectToSignIn()This allows for redirectingToSignIn at the page level and provides parity with Nextjs.
Note: We are not exposing
auth().protect()because DX is taking a hit, because we cannot just throw a response in astro, we need to return it. And we are not including protect at the middleware level so we don't confuse people that would expect it to work at page level.Checklist
npm testruns as expected.npm run buildruns as expected.Type of change