Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/docs/configuration/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export { default } from "next-auth/middleware"
```

That's it! Your application is now secured. 🎉
Every page will be protected except the sign-in page, the authentication path, the authentication error page and some public paths (`/_next` and `/favicon.ico`).

If you only want to secure certain pages, export a `config` object with a `matcher`:

Expand All @@ -164,7 +165,7 @@ export const config = { matcher: ["/dashboard"] }

Now you will still be able to visit every page, but only `/dashboard` will require authentication.

If a user is not logged in, the default behavior is to redirect them to the sign-in page.
If a user is not logged in, the default behavior is to redirect them to the sign-in page, with a `callbackUrl` query param to redirect the user back after a successful login.

---

Expand Down
Loading