fixing check token auth
This commit is contained in:
parent
46d561b43b
commit
a5fbf5c880
3 changed files with 36 additions and 16 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { defineStore } from 'pinia'
|
||||
import CustomComponent from '@/components/CustomDialog.vue'
|
||||
import { Loading, QSpinnerCube } from 'quasar'
|
||||
import { kcLogout } from '@/plugins/keycloak'
|
||||
|
||||
export const useCounterMixin = defineStore('mixin', () => {
|
||||
function date2Thai(srcDate: Date, isFullMonth = false, isTime = false) {
|
||||
|
|
@ -143,6 +144,12 @@ export const useCounterMixin = defineStore('mixin', () => {
|
|||
color: 'red',
|
||||
onlycancel: true,
|
||||
},
|
||||
}).onCancel(async () => {
|
||||
showLoader()
|
||||
await kcLogout()
|
||||
setTimeout(() => {
|
||||
hideLoader()
|
||||
}, 1000)
|
||||
})
|
||||
} else {
|
||||
const message = e.response.data.result ?? e.response.data.message
|
||||
|
|
@ -169,6 +176,12 @@ export const useCounterMixin = defineStore('mixin', () => {
|
|||
color: 'red',
|
||||
onlycancel: true,
|
||||
},
|
||||
}).onCancel(async () => {
|
||||
showLoader()
|
||||
await kcLogout()
|
||||
setTimeout(() => {
|
||||
hideLoader()
|
||||
}, 1000)
|
||||
})
|
||||
} else {
|
||||
//invalid_token
|
||||
|
|
@ -181,6 +194,12 @@ export const useCounterMixin = defineStore('mixin', () => {
|
|||
color: 'red',
|
||||
onlycancel: true,
|
||||
},
|
||||
}).onCancel(async () => {
|
||||
showLoader()
|
||||
await kcLogout()
|
||||
setTimeout(() => {
|
||||
hideLoader()
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
} else if (e.response.data.successful === false) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue