I have a login page that I would like for logged in users not be able to see. My component is as follow:
<template>...</template>
<script lang="ts">
...
@Component({
layout: 'fullWidth',
auth: 'guest',
components: {
Base,
BaseAuth,
}
})
export default class Login extends Vue { ... }
</script>
After login if I go to the /login route it allows me to view the page. My nuxt configuration is as follow:
auth: {
redirect: {
login: '/login',
logout: '/',
// callback: '/login',
home: '/'
},
strategies: {
local: {
endpoints: {
login: { url: '/auth/login', method: 'post', propertyName: 'token' },
logout: { url: '/auth/logout', method: 'post' },
user: { url: '/auth/user', method: 'get', propertyName: 'user' }
},
}
}
}
Is there any other configuration that I should do?