From 28ff7439116a7bb13eb28922e0b9a1e99fc16ac3 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 20 Dec 2024 22:48:33 +0700 Subject: [PATCH] check cookie redirect sso --- src/router/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 247aa3c..262ae6e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -4,7 +4,7 @@ import MapView from '@/views/MapView.vue' import MainView from '@/views/MainView.vue' const loginView = () => import('@/views/login.vue') -import { authenticated } from '@/plugins/auth' +import { authenticated, logout } from '@/plugins/auth' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -85,7 +85,7 @@ router.beforeEach(async (to, from, next) => { if (to.meta.Auth) { const checkAuthen = await authenticated() if (!checkAuthen && to.meta.Auth) { - router.push({ name: 'loginMain' }) + logout() } } else { next()