If the user is already logged-in then how can I redirect user to "dashboard" if he tries to visit the "sign-in" page?
In current scenario:
If the user is logged-in, still able to visit "sign-in" page and type login credentials.
Hi,
You can implement this in file src/components/page-layouts/Auth.vue
Inside the mounted function check if a user is authenticated and if he is already authenticated you can redirect the user to a dashboard page.
onMounted(() => {
if (store.getters.isUserAuthenticated) {
router.push({ name: "dashboard" });
}
});
thanks