|
|
@@ -74,10 +74,10 @@ const router = createRouter({
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
if (to.matched.some((record) => record.meta.requiresAuth)) {
|
|
|
// this route requires auth, check if logged in
|
|
|
- // if not, redirect to login page.
|
|
|
+ // if not, redirect to home page.
|
|
|
if (!isUserLoggedIn()) {
|
|
|
next({
|
|
|
- name: LOGIN,
|
|
|
+ name: HOME,
|
|
|
query: { redirect: to.fullPath },
|
|
|
});
|
|
|
} else {
|
|
|
@@ -89,7 +89,7 @@ router.beforeEach((to, from, next) => {
|
|
|
});
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
- if (to.name !== LOGIN || !isUserLoggedIn()) {
|
|
|
+ if (to.name !== HOME || !isUserLoggedIn()) {
|
|
|
next();
|
|
|
}
|
|
|
});
|