updated authen with keycloak client
This commit is contained in:
parent
93cf472aae
commit
9ec6a7696a
8 changed files with 378 additions and 32 deletions
|
|
@ -37,6 +37,7 @@ app.component(
|
|||
|
||||
app.config.globalProperties.$http = http
|
||||
|
||||
// authen with keycloak client
|
||||
function getCookie(name: string) {
|
||||
const nameEQ = name + '='
|
||||
const ca = document.cookie.split(';')
|
||||
|
|
@ -61,9 +62,11 @@ if (kcToken && kcRefreshToken) {
|
|||
})
|
||||
.then((authenticated) => {
|
||||
console.log('authenticated', authenticated)
|
||||
// // // if (authenticated) {
|
||||
// // // app.mount('#app')
|
||||
// // // }
|
||||
if (!authenticated) {
|
||||
window.location.reload()
|
||||
} else {
|
||||
console.log('Authenticated')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Keycloak initialization failed:', err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue