This commit is contained in:
Warunee Tamkoo 2024-08-08 10:28:20 +07:00
parent 6a2ce4320c
commit b55b88b72e
3 changed files with 3 additions and 3 deletions

View file

@ -33,7 +33,7 @@ http.interceptors.response.use(
// eslint-disable-next-line no-prototype-builtins
if (error.hasOwnProperty("response")) {
if (error.response.status === 401 || error.response.status === 403) {
// kcLogout();
kcLogout();
// Store.commit("SET_ERROR_MESSAGE", error.response.data.message);
// Store.commit("REMOVE_ACCESS_TOKEN")
}

View file

@ -24,7 +24,7 @@ async function kcLogout() {
if (keycloak.authenticated !== undefined) {
keycloak.logout();
}
// window.location.href = "/login";
window.location.href = "/login";
}
async function getToken() {

View file

@ -112,7 +112,7 @@ const router = createRouter({
router.beforeEach((to, from, next) => {
if (to.meta.Auth) {
if (keycloak.authenticated === undefined) {
// kcLogout();
kcLogout();
} else {
next();
}