From 302354b3deab15713936f55aca442401f7a87d7c Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 21 Mar 2023 09:56:49 +0700 Subject: [PATCH] no message --- src/router/index.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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