Update nextjs-auth0 to v4#182
Closed
frederikprijck wants to merge 7 commits intoauth0-samples:mainfrom
Closed
Conversation
f3e43e6 to
6f1a9bf
Compare
Comment on lines
+13
to
+14
| scope: "openid profile email read:shows", | ||
| audience: process.env.AUTH0_AUDIENCE, |
Contributor
There was a problem hiding this comment.
Seems quite strange that for one of these fields we are hardocding and for the other we are reading from env. Can we make this consistent? IMO since SDK does not read process.env.AUTH0_AUDIENCE automatically, this should be made apparent to the user. If there are plans to restore this behaviour, the same can be changed later.
Contributor
Author
There was a problem hiding this comment.
I do not think environment variables are solely useful when the SDK picks them up automatically.
I will make that clear by adding a comment that the SDK no longer picks up AUTH0_AUDIENCE automatically, ansd that we need to pass it in here. I will also bring back process.env.AUTH0_SCOPE.
6f1a9bf to
f828aed
Compare
Contributor
Author
|
Replacing by #186 |
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.
This PR updates the sample application to use v4 of the
@auth0/nextjs-auth0SDK.The most significant change is that the authentication is handled by the middleware now, and we no longer have things such as
withApiAuthRequiredandwithPageAuthRequired.Additionally, we introduce a
lib/auth0file, which we use to call things such asgetSession()andgetAccessToken().Let's first merge #181, then I will rebase this branch to simplify the diff.