success validate getting token via cookie
This commit is contained in:
1 parent
a63c85796b
commit
bee5606474
6 files changed
+29
-5
No files matched your search
+3
-2
@@ -1,8 +1,9 @@
|
||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
||||
import auth from './auth';
|
||||
import course from './course';
|
||||
import store from '@/store';
|
||||
|
||||
const routes = [auth];
|
||||
const routes = [auth, course];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
@@ -14,7 +15,7 @@ router.beforeEach((to, from, next) => {
|
||||
if (to.matched.some((record) => record.meta.auth)) {
|
||||
if (!store.getters.authenticated) {
|
||||
next({
|
||||
name: 'login',
|
||||
name: 'auth-login',
|
||||
query: { redirect: to.fullPath }
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user