feat: login redirect opgelost
This commit is contained in:
parent
37ecad30ea
commit
49f1a98eec
2 changed files with 11 additions and 10 deletions
|
@ -109,9 +109,9 @@ const router = createRouter({
|
|||
});
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
// Verify if user is logged in for paths that require authentication
|
||||
// Verify if user is logged in before accessing certain routes
|
||||
if (to.meta.requiresAuth) {
|
||||
if (!authState.isLoggedIn) {
|
||||
if (!authState.isLoggedIn.value) {
|
||||
next("/login");
|
||||
} else {
|
||||
next();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue