You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`AUTH0_SECRET`: A long secret value used to encrypt the session cookie. You can generate a suitable string using `openssl rand -hex 32` on the command line.
47
-
-`APP_BASE_URL`: The base URL of your application.
48
-
-`AUTH0_DOMAIN`: The URL of your Auth0 tenant domain. If you are using a <ahref="https://auth0.com/docs/custom-domains"target="_blank"rel="noreferrer">Custom Domain with Auth0</a>, set this to the value of your Custom Domain instead of the value reflected in the "Settings" tab.
49
-
-`AUTH0_CLIENT_ID`: Your Auth0 application's Client ID.
50
-
-`AUTH0_CLIENT_SECRET`: Your Auth0 application's Client Secret.
47
+
-`APP_BASE_URL`: The base URL of your application
48
+
-`AUTH0_DOMAIN`: The URL of your Auth0 tenant domain
49
+
-`AUTH0_CLIENT_ID`: Your Auth0 application's Client ID
50
+
-`AUTH0_CLIENT_SECRET`: Your Auth0 application's Client Secret
51
51
52
52
The SDK will read these values from the Node.js process environment and configure itself automatically.
53
53
54
54
::: note
55
55
Manually add the values for `AUTH0_AUDIENCE` and `AUTH_SCOPE` to the file `lib/auth0.js`. These values are not configured automatically.
56
+
If you are using a <ahref="https://auth0.com/docs/custom-domains"target="_blank"rel="noreferrer">Custom Domain with Auth0</a>, set this to the value of your Custom Domain instead of the value reflected in the "Settings" tab.
56
57
:::
57
58
58
59
### Create the Auth0 SDK Client
@@ -121,27 +122,27 @@ export const GET = async function shows() {
121
122
};
122
123
```
123
124
124
-
Upon execution the following routes for your customers are available:
125
+
Upon execution, the following routes for your customers are available:
125
126
126
-
-`/auth/login`: The route to perform login with Auth0.
127
-
-`/auth/logout`: The route to log the user out.
128
-
-`/auth/callback`: The route Auth0 will redirect the user to after a successful login.
129
-
-`/auth/profile`: The route to fetch the user profile.
130
-
-`/auth/access-token`: The route to verify the user's session and return an access token (which automatically refreshes if a refresh token is available).
131
-
-`/auth/backchannell-logout`: The route to receive a logout_token when a configured Back-Channel Logout initiator occurs.
127
+
-`/auth/login`: The route to perform login with Auth0
128
+
-`/auth/logout`: The route to log the user out
129
+
-`/auth/callback`: The route Auth0 will redirect the user to after a successful login
130
+
-`/auth/profile`: The route to fetch the user profile
131
+
-`/auth/access-token`: The route to verify the user's session and return an access token (which automatically refreshes if a refresh token is available)
132
+
-`/auth/backchannell-logout`: The route to receive a `logout_token` when a configured Back-Channel Logout initiator occurs
132
133
133
134
To learn more about routing in Auth0, read <ahref="https://auth0.com/blog/auth0-stable-support-for-nextjs-app-router/"target="_blank"rel="noreferrer"> Add the dynamic API route</a>.
134
135
135
136
## Add Login to Your Application
136
137
137
-
Users can now log in to your application at `/api/auth/login` route provided by the SDK. Use an **anchor tag** to add a link to the login route, the route redirects your users to the Auth0 Universal Login Page, where Auth0 can authenticate them. Upon successful authentication, Auth0 redirects your users back to your application.
138
+
Users can now log in to your application at `/api/auth/login` route provided by the SDK. Use an **anchor tag** to add a link to the login route to redirect your users to the Auth0 Universal Login Page, where Auth0 can authenticate them. Upon successful authentication, Auth0 redirects your users back to your application.
138
139
139
140
```html
140
141
<ahref="/auth/login">Login</a>
141
142
```
142
143
143
144
:::note
144
-
Next suggest using <ahref="https://nextjs.org/docs/api-reference/next/link"target="_blank"rel="noreferrer">Link</a> components instead of anchor tags, but since these are API routes and not pages, anchor tags are needed.
145
+
Next.js suggest using <ahref="https://nextjs.org/docs/api-reference/next/link"target="_blank"rel="noreferrer">Link</a> components instead of anchor tags, but since these are API routes and not pages, anchor tags are needed.
0 commit comments