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
Copy file name to clipboardexpand all lines: articles/quickstart/webapp/nextjs/interactive.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ The SDK will read these values from the Node.js process environment and automati
54
54
55
55
## Create the Auth0 SDK Client {{{ data-action=code data-code="src/lib/auth0.ts" }}}
56
56
57
-
Create a file at `src/lib.auth0.ts`. This file provides methods for handling authentication, sessions and user data.
57
+
Create a file at `src/lib/auth0.ts`. This file provides methods for handling authentication, sessions and user data.
58
58
59
59
Then, import the `Auth0Client` class from the SDK to create an instance and export it as `auth0`. This instance is used in your app to interact with Auth0.
60
60
@@ -67,13 +67,13 @@ The Next.js Middleware allows you to run code before a request is completed.
67
67
Create a file at `src/middleware.ts`. This file is used to enforce authentication on specific routes.
68
68
69
69
The `middleware` function intercepts incoming requests and applies Auth0's authentication logic.
70
-
The `matcher` configuration ensures that the middleware runs on all routes except for statis files and metadata.
70
+
The `matcher` configuration ensures that the middleware runs on all routes except for static files and metadata.
71
71
72
72
## Add the Landing Page Content {{{ data-action=code data-code="src/app/page.tsx" }}}
73
73
74
74
The Landing page `src/app/page.tsx` is where users interact with your app. It displays different content based on whether the users is logged in or not.
75
75
76
-
Edit the file `src/app/page.tsx` to add the `auht0.getSession()` method to determine if the user is logged in by retrieving the user session.
76
+
Edit the file `src/app/page.tsx` to add the `auth0.getSession()` method to determine if the user is logged in by retrieving the user session.
77
77
78
78
If there is no user session, the method returns `null` and the app displays the **Sign up** or **Log in** buttons.
79
79
If a user sessions exists, the app displays a welcome message with the user's name and a **Log out** button.
0 commit comments