diff --git a/src/router/index.ts b/src/router/index.ts index 24f600a..f7cf0f1 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -65,20 +65,20 @@ const router = createRouter({ // ] // }) router.beforeEach((to, from, next) => { - // if (to.meta.Auth) { - // if (!keycloak.authenticated) { - // keycloak.login({ - // redirectUri: `${window.location.protocol}//${window.location.host}${to.path}`, - // locale: 'th' - // }) - // } else { - // // keycloak.updateToken(60); - // next() - // } - // } else { - // next() - // } - next() + if (to.meta.Auth) { + if (!keycloak.authenticated) { + keycloak.login({ + redirectUri: `${window.location.protocol}//${window.location.host}${to.path}`, + locale: 'th' + }) + } else { + // keycloak.updateToken(60); + next() + } + } else { + next() + } + // next() }) export default router