Unverified Commit cc57fe85 authored by Landon Colburn's avatar Landon Colburn Committed by GitHub

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: 's avatarSam Ko <sam@vercel.com>
parent a00458b5
......@@ -332,15 +332,22 @@ Once a user is authenticated, you'll need to ensure the user is allowed to visit
Here's how to implement Middleware for authentication in Next.js:
1. **Setting Up Middleware:**
- Create a `middleware.ts` or `.js` file in your project's root directory.
- Include logic to authorize user access, such as checking for authentication tokens.
2. **Defining Protected Routes:**
- Not all routes require authorization. Use the `matcher` option in your Middleware to specify any routes that do not require authorization checks.
3. **Middleware Logic:**
- Write logic to verify if a user is authenticated. Check user roles or permissions for route authorization.
4. **Handling Unauthorized Access:**
- Redirect unauthorized users to a login or error page as appropriate.
#### Setting Up Middleware:
- Create a `middleware.ts` or `.js` file in your project's root directory.
- Include logic to authorize user access, such as checking for authentication tokens.
#### Defining Protected Routes:
- Not all routes require authorization. Use the `matcher` option in your Middleware to specify any routes that do not require authorization checks.
#### Middleware Logic:
- Write logic to verify if a user is authenticated. Check user roles or permissions for route authorization.
#### Handling Unauthorized Access:
- Redirect unauthorized users to a login or error page as appropriate.
Example Middleware file:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment