check cookie redirect sso

This commit is contained in:
Warunee Tamkoo 2024-12-20 22:45:41 +07:00
parent c489c78a99
commit a43279b314

View file

@ -22,8 +22,7 @@ import ModulePortfolio from "@/modules/13_portfolio/router";
import ModuleDevelop from "@/modules/14_IDP/router";
import ModuleProbationReport from "@/modules/15_probationReport/router";
import { authenticated, tokenParsed } from "@/plugins/auth";
import { ro } from "date-fns/locale";
import { authenticated, logout } from "@/plugins/auth";
// TODO: ใช้หรือไม่?
const router = createRouter({
@ -96,7 +95,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();
}
}
next();