From 103446dac31c73eb5db76a73a33875678e7244c1 Mon Sep 17 00:00:00 2001 From: Capi Huamani Date: Fri, 16 Oct 2026 18:10:44 -0300 Subject: [PATCH] Further document withAuth behavior Document default proxy intentional exceptions. Document callbackUrl query param on redirections. --- docs/docs/configuration/nextjs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/docs/configuration/nextjs.md b/docs/docs/configuration/nextjs.md index 10c178e1ae..b0d72486ef 100644 --- a/docs/docs/configuration/nextjs.md +++ b/docs/docs/configuration/nextjs.md @@ -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`: @@ -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. ---