Skip to content
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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

BcnCarlos
Copy link
Contributor

No description provided.

Edited Callback URL path
Updated author and Next.js requirements
reverted author info
Updated Quickstart from V3 -> V4.
avanscoy
avanscoy previously approved these changes Mar 31, 2025
@BcnCarlos BcnCarlos requested a review from frederikprijck April 1, 2025 08:48
@BcnCarlos BcnCarlos requested a review from frederikprijck April 1, 2025 09:12
tusharpandey13
tusharpandey13 previously approved these changes Apr 2, 2025
@BcnCarlos BcnCarlos requested a review from frederikprijck April 2, 2025 08:39
arpit-jn
arpit-jn previously approved these changes Apr 7, 2025

### 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>.
Copy link
Member

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?

Comment on lines 77 to 99
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. :::
Copy link
Member

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

Comment on lines 162 to 172
<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>
Copy link
Member

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.

@frederikprijck frederikprijck dismissed stale reviews from arpit-jn and tusharpandey13 via 0fe52d3 April 7, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants