fix: redirect to map on social login

This commit is contained in:
wancat committed 2023-11-21 23:23:20 +08:00
1 parent 7320688827
commit 5b71944588
1 file changed
+4 -9
+4 -9
View File
@@ -10,11 +10,9 @@ const routes = [
{
path: '/',
redirect: {
name: 'game',
params: {
questId: 'helloworld',
},
name: 'register',
},
meta: { requiresGuest: true },
},
{
path: '/login',
@@ -66,13 +64,10 @@ router.beforeEach(async (to, from, next) => {
})
} else if (to.meta.requiresGuest && loggedIn) {
next({
name: 'game', // Or any default authenticated user route
params: {
questId: 'helloworld',
},
name: 'map',
})
} else {
next() // Always call next() at the end
next()
}
})