From 67d136c2bbb3dd35e96240ae516e46d586173f0c Mon Sep 17 00:00:00 2001 From: waruneeta Date: Tue, 6 Feb 2024 12:15:32 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20redirect?= =?UTF-8?q?=20=E0=B8=84=E0=B8=99=E0=B8=81=E0=B8=A3=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9=E0=B8=A5=E0=B8=97?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index cda3824d6..d8095bbb7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -93,7 +93,11 @@ router.beforeEach((to, from, next) => { } else { // keycloak.updateToken(60); const role = keycloak.tokenParsed?.role; - if (role.includes(to.meta.Role)) { + + // ถ้าเป็นคนกรอกข้อมูล + if (role.includes("keyregistry") && to.meta.Role != "registry") { + next({ path: "/registry" }); + } else if (role.includes(to.meta.Role)) { next(); } else { next({ path: "" });