Skip to content

Commit

Permalink
refactor: no significant change
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Mar 11, 2024
1 parent d8e03bb commit d4fb37e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/runtime/middleware/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ export default defineNuxtRouteMiddleware((to) => {

const isPageFound = to.matched.length > 0

if (!isPageFound && process.server) {
if ((!isPageFound && process.server) || (config.auth.enableGlobalAuthMiddleware && to.meta.auth === false)) {
return
}

if (config.auth.enableGlobalAuthMiddleware === true) {
if (to.meta.auth === false) {
return
}
}

if (!useDirectusToken().value) {
return navigateTo({
path: config.auth.redirect.login,
Expand Down

0 comments on commit d4fb37e

Please sign in to comment.