-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update nextjs non-interactive quickstart #10520
base: master
Are you sure you want to change the base?
Conversation
Edited Callback URL path
Updated author and Next.js requirements
reverted author info
Updated Quickstart from V3 -> V4.
|
||
### Add the `UserProvider` component | ||
To learn more about routing in Auth0, read <a href="https://auth0.com/blog/auth0-stable-support-for-nextjs-app-router/" target="_blank" rel="noreferrer"> Add the dynamic API route</a>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This points to a blog post that uses nextjs v3. Is this intentional? I am also a bit confused by this link in general. Why not link to our own section below Create custom routes using the dynamic API route handler
?
On the frontend side, the SDK uses React Context to manage the authentication state of your users. To make that state available to all your pages, you need to override the <a href="https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#root-layout-required" target="_blank" rel="noreferrer">Root Layout component</a> and wrap the `<body>` tag with a `UserProvider` in the file `app/layout.jsx`. | ||
:::note | ||
The `/auth/access-token` route is enabled by default. If your clients do not need access tokens, you can disable the route by editing the file `lib/auth0.js` and setting `enableAccessTokenEndpoint` to `false` in the instance of the Auth0 client. ::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rephrase this ? When access tokens are used, clients will allows need access to these. See my PR to update the readme of the repository: auth0/nextjs-auth0#2044
<div data-testid="profile" style={{ textAlign: "center" }}> | ||
<img | ||
src={user.picture} | ||
alt="Profile" | ||
style={{ borderRadius: "50%", width: "80px", height: "80px" }} | ||
data-testid="profile-picture" | ||
/> | ||
<h2 data-testid="profile-name">{user.name}</h2> | ||
<p data-testid="profile-email">{user.email}</p> | ||
<pre data-testid="profile-json">{JSON.stringify(user, null, 2)}</pre> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need the data-testid
, this is specific to our sample app.
0fe52d3
No description provided.