From 57c1431ac62e61ed6674b45f8ef526c45ccc76f1 Mon Sep 17 00:00:00 2001 From: Louis Haftmann <30736553+LouisHaftmann@users.noreply.github.com> Date: Sat, 23 Sep 2023 11:58:58 +0200 Subject: [PATCH] feat: protected route redirect overwrite per page (#424) Co-authored-by: Zoey --- .../3.application-side/4.protecting-pages.md | 3 ++- .../3.application-side/4.protecting-pages.md | 14 ++++++++++ src/runtime/middleware/auth.ts | 27 +++++++++++++++++-- 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/docs/content/3.application-side/4.protecting-pages.md b/docs/content/3.application-side/4.protecting-pages.md index 839f27c7..fd436567 100644 --- a/docs/content/3.application-side/4.protecting-pages.md +++ b/docs/content/3.application-side/4.protecting-pages.md @@ -1,6 +1,7 @@ # Protecting Pages `nuxt-auth` offers different approaches to protect pages: + 1. Global protection: Protects all pages with manual exceptions 2. Local protection: Protects specific pages 3. Custom middleware: Create your own middleware @@ -48,6 +49,7 @@ That's it! Every page of your application will now need authentication for the u ### Disabling the global middleware locally To disable the global middleware on a specific page only, you can use the [`definePageMeta` macro](https://nuxt.com/docs/api/utils/define-page-meta#definepagemeta) to turn `auth` off: + ```vue