I created a folder middleware and a file called auth.js.
auth.js
export default function auth() {
console.log('auth!')
}
And in nuxt.config.js
I'm calling it in router object.
router: {
middleware: ['auth']
},
And every page that I enter I see the console.log I put in Auth.js. And what I'm trying to do is to avoid the middleware to run in Login page, but even when I set it to false, it runs.
Login.vue
<template>
<div class="div">LOGIN PAGE!!!</div>
</template>
<script>
export default {
auth: false
}
</script>