check cookie redirect to sso
This commit is contained in:
parent
3d85971eee
commit
dbf6fe0123
1 changed files with 4 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ import ModuleCommand from "@/modules/18_command/router";
|
|||
import ModulePositionCondition from "@/modules/19_condition/router";
|
||||
|
||||
// TODO: ใช้หรือไม่?
|
||||
import { authenticated } from "@/plugins/auth";
|
||||
import { authenticated, logout } from "@/plugins/auth";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
|
|
@ -117,8 +117,10 @@ const router = createRouter({
|
|||
router.beforeEach(async (to, from, next) => {
|
||||
if (to.meta.Auth) {
|
||||
const checkAuthen = await authenticated();
|
||||
console.log("checkAuthen", checkAuthen);
|
||||
|
||||
if (!checkAuthen && to.meta.Auth) {
|
||||
router.push({ name: "loginMain" });
|
||||
logout();
|
||||
}
|
||||
}
|
||||
next();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue