Skip to content

Commit cc57fe8

Browse files
landoncolburnsamcx
andauthored
Fixed Authentication docs improper nesting of unordered list inside ordered list (#62958)
On the Building Your Application: Authentication page, the formatting is broken in the "Setting Up Middleware" section because the unordered list is nested inside the ordered list. This is causing the unordered list components to be numbered and throw off the ordering of the top level list. I made a tiny change to the markdown to make the top level steps h4 titles, and un-nested the unordered list's Closes NEXT-61838 Fixes #61838 Co-authored-by: Sam Ko <sam@vercel.com>
1 parent a00458b commit cc57fe8

File tree

1 file changed

+16
-9
lines changed
  • docs/02-app/01-building-your-application/09-authentication

1 file changed

+16
-9
lines changed

docs/02-app/01-building-your-application/09-authentication/index.mdx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,22 @@ Once a user is authenticated, you'll need to ensure the user is allowed to visit
332332

333333
Here's how to implement Middleware for authentication in Next.js:
334334

335-
1. **Setting Up Middleware:**
336-
- Create a `middleware.ts` or `.js` file in your project's root directory.
337-
- Include logic to authorize user access, such as checking for authentication tokens.
338-
2. **Defining Protected Routes:**
339-
- Not all routes require authorization. Use the `matcher` option in your Middleware to specify any routes that do not require authorization checks.
340-
3. **Middleware Logic:**
341-
- Write logic to verify if a user is authenticated. Check user roles or permissions for route authorization.
342-
4. **Handling Unauthorized Access:**
343-
- Redirect unauthorized users to a login or error page as appropriate.
335+
#### Setting Up Middleware:
336+
337+
- Create a `middleware.ts` or `.js` file in your project's root directory.
338+
- Include logic to authorize user access, such as checking for authentication tokens.
339+
340+
#### Defining Protected Routes:
341+
342+
- Not all routes require authorization. Use the `matcher` option in your Middleware to specify any routes that do not require authorization checks.
343+
344+
#### Middleware Logic:
345+
346+
- Write logic to verify if a user is authenticated. Check user roles or permissions for route authorization.
347+
348+
#### Handling Unauthorized Access:
349+
350+
- Redirect unauthorized users to a login or error page as appropriate.
344351

345352
Example Middleware file:
346353

0 commit comments

Comments
 (0)