fixing check token
This commit is contained in:
parent
5e1dd0d2d7
commit
f4592d2844
2 changed files with 1 additions and 4 deletions
|
|
@ -104,7 +104,6 @@ if (kcToken && kcRefreshToken) {
|
|||
token: kcToken,
|
||||
refreshToken: kcRefreshToken,
|
||||
});
|
||||
keycloak.authenticated = true;
|
||||
|
||||
// .then((authenticated) => {
|
||||
// console.log("authenticated", authenticated);
|
||||
|
|
@ -117,8 +116,6 @@ if (kcToken && kcRefreshToken) {
|
|||
// .catch((err) => {
|
||||
// console.error("Keycloak initialization failed:", err);
|
||||
// });
|
||||
} else {
|
||||
keycloak.authenticated = false;
|
||||
}
|
||||
|
||||
app.mount("#app");
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ const router = createRouter({
|
|||
// authen with keycloak client
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.meta.Auth) {
|
||||
if (keycloak.authenticated === false && to.meta.Auth) {
|
||||
if (keycloak.authenticated === undefined && to.meta.Auth) {
|
||||
window.location.href = "/login";
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue