Open lukaszflorczak opened 1 year ago
I'm having the same issue. having an include option would be great!
@lukaszflorczak I agree, this is a common issue I've run into multiple times.
Having a useAuth
boolean in the config would also be nice for websites that don't require auth.
However, I have found that exclude: ['/*']
also does the trick.
i agree
+1
I totally agree. I want everything under /app/ to require auth and nothing else so an include option is a must.
Up for this feature!
For now a workaround is to reverse engineer this regex here to behave like an include:
For instance, If you only need the /dashboard
path to be considered, use this pattern in nuxt.config
:
{
exclude: ['(?!*\/dashboard*)*']
}
I just saw that it's implemented. now you can use include:
redirectOptions: {
login: '/login',
callback: '/confirm',
include: ['/dashboard(/*)?'],
}
"
include
: Routes to include in the redirect. ['/dashboard(/*)?']
will enable the redirect only for the dashboard page and all sub-pages.
"
https://supabase.nuxtjs.org/get-started#redirectoptions
I believe that it would be highly beneficial to have an option that serves as the opposite of the 'exclude' param. In my specific use case, I have numerous public pages, including multiple versions of landing pages that are directly accessible from the root (
/landing-page-name
). Consequently, excluding them using wildcards seems to be impossible. On the other hand, there is only one URL (/dashboard/**
) that requires authentication.