Skip to content

Commit

Permalink
feat: add 'unauthenticatedOnly' default value
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisHaftmann committed Aug 11, 2023
1 parent d5578c9 commit beb621a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/runtime/middleware/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ declare module '#app/../pages/runtime/composables' {
}

export default defineNuxtRouteMiddleware((to) => {
const metaAuth = to.meta.auth
const metaAuth = typeof to.meta.auth === 'object'
? {
unauthenticatedOnly: true,
...to.meta.auth
}
: to.meta.auth

if (metaAuth === false) {
return
}
Expand Down

0 comments on commit beb621a

Please sign in to comment.