fixing check token
This commit is contained in:
parent
04da1988b0
commit
00cb0c6f23
7 changed files with 83 additions and 66 deletions
13
src/main.ts
13
src/main.ts
|
|
@ -3,7 +3,7 @@ import App from '@/App.vue'
|
|||
import '@/registerServiceWorker'
|
||||
import router from '@/router'
|
||||
import { createPinia } from 'pinia'
|
||||
import keycloak from '@/plugins/keycloak'
|
||||
import keycloak, { getToken } from '@/plugins/keycloak'
|
||||
|
||||
import { Quasar, Dialog, Notify, Loading } from 'quasar'
|
||||
import '@vuepic/vue-datepicker/dist/main.css'
|
||||
|
|
@ -49,16 +49,15 @@ function getCookie(name: string) {
|
|||
return null
|
||||
}
|
||||
|
||||
const kcToken = getCookie('BMAHRIS_KEYCLOAK_IDENTITY')
|
||||
const kcRefreshToken = getCookie('BMAHRIS_KEYCLOAK_REFRESH')
|
||||
const auth = await getToken()
|
||||
|
||||
if (kcToken && kcRefreshToken) {
|
||||
if (auth.token && auth.refresh_token) {
|
||||
keycloak.init({
|
||||
// onLoad: 'login-required',
|
||||
checkLoginIframe: false,
|
||||
token: kcToken,
|
||||
refreshToken: kcRefreshToken,
|
||||
token: auth.token,
|
||||
refreshToken: auth.refresh_token,
|
||||
})
|
||||
|
||||
// .then((authenticated) => {
|
||||
// console.log('authenticated', authenticated)
|
||||
// if (!authenticated) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue