-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(app): add include
to RedirectOptions
#336
Conversation
✅ Live Preview ready!
|
👷 Deploy request for n3-supabase pending review.Visit the deploys page to approve it
|
037f804
to
ae5ad9c
Compare
include
to RedirectOptions
include
to RedirectOptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! LGTM except two little things. If you can just update, I'll merge then
src/runtime/plugins/auth-redirect.ts
Outdated
const { cookieName, cookieOptions } = config | ||
|
||
// Redirect only on included routes (if defined) | ||
if (include && include.length > 0) { | ||
const isIncluded = [...include].some((path) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const isIncluded = [...include].some((path) => { | |
const isIncluded = include.some((path) => { |
playground/pages/protected/index.vue
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create pages/protected.vue
instead? (just to be consistent with the unprotected
route)
ae5ad9c
to
726ba14
Compare
Thanks for the feedback. I've force pushed with the two changes :) |
Closes #268
Types of changes
Description
Add an
include
option toRedirectOptions
. If set, only routes matching the supplied regex are considered for redirects.Checklist: