fixing bug check token
This commit is contained in:
parent
177b85a6a9
commit
04da1988b0
2 changed files with 1 additions and 4 deletions
|
|
@ -59,7 +59,6 @@ if (kcToken && kcRefreshToken) {
|
|||
token: kcToken,
|
||||
refreshToken: kcRefreshToken,
|
||||
})
|
||||
keycloak.authenticated = true
|
||||
// .then((authenticated) => {
|
||||
// console.log('authenticated', authenticated)
|
||||
// if (!authenticated) {
|
||||
|
|
@ -71,8 +70,6 @@ if (kcToken && kcRefreshToken) {
|
|||
// .catch((err) => {
|
||||
// console.error('Keycloak initialization failed:', err)
|
||||
// })
|
||||
} else {
|
||||
keycloak.authenticated = false
|
||||
}
|
||||
|
||||
app.mount('#app')
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ router.beforeEach((to, from, next) => {
|
|||
console.log('keycloak==>', keycloak.authenticated)
|
||||
|
||||
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