fixing check token
This commit is contained in:
parent
8d51e6f623
commit
f6b2b26998
5 changed files with 33 additions and 21 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import Axios, { type AxiosRequestConfig, type AxiosResponse } from "axios";
|
||||
import keycloak from "./keycloak";
|
||||
import keycloak, { kcLogout } from "./keycloak";
|
||||
|
||||
const http = Axios.create({
|
||||
timeout: 1000000000, // เพิ่มค่า timeout
|
||||
|
|
@ -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) {
|
||||
window.location.href = "/login";
|
||||
kcLogout();
|
||||
|
||||
// Store.commit("SET_ERROR_MESSAGE", error.response.data.message);
|
||||
// Store.commit("REMOVE_ACCESS_TOKEN")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue