updated authen with keycloak client

This commit is contained in:
Warunee Tamkoo 2024-07-23 14:46:40 +07:00
parent 93cf472aae
commit 9ec6a7696a
8 changed files with 378 additions and 32 deletions

View file

@ -98,13 +98,14 @@ function onClickLogout() {
persistent: true,
}).onOk(async () => {
// keycloak.logout()
// authen with keycloak client
await deleteCookie('BMAHRIS_KEYCLOAK_IDENTITY')
await deleteCookie('BMAHRIS_KEYCLOAK_REFRESH')
window.location.href = 'https://bma-sso.frappet.synology.me'
window.location.href = '/login'
})
}
function deleteCookie(name) {
function deleteCookie(name: string) {
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`
}