I have a website where the user logs in and then gets access to a dashboard. The user can log in and out from their dashboard as well as from the home page. Now I want that when the user logs out from the dashboard, he gets directed to a different page than when he logs out from the home page. Is this somehow possible with the auth module in Nuxt? I haven't found a way so far.
my nuxt.config.js looks like this at the moment:
auth: {
redirect: {
home: "/",
login: "/"
},
strategies: {
local: {
endpoints: {
login: { url: "/api/session", method: "post" },
logout: { url: "/api/session", method: "destroy" },
user: { url: "/api/settings", method: "get", propertyName: false }
},
tokenType: 'Bearer'
}
},
redirect: {
login: '/',
logout: '/',
home: false,
},
}
And then there is the button from the home page:
<span v-if="this.$store.state.auth.loggedIn" class="inline-flex rounded-md shadow">
<button
@click="$auth.logout()"
v-scroll-to="'#login'"
>Logout</button>
</span>
and the button from the Dashboard:
<button
@click="$auth.logout()"
>
<span class="font-normal text-sm mt-0/5">Logout</span>
</button>