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: "" });