diff --git a/frontend/src/api/interceptors.ts b/frontend/src/api/interceptors.ts index 693e67f3b..841560604 100644 --- a/frontend/src/api/interceptors.ts +++ b/frontend/src/api/interceptors.ts @@ -48,8 +48,12 @@ export const handleTokenError = async (error: AxiosError) => status === HTTP_STATUS_CODE.BAD_REQUEST && (data.code === ERROR_CODE.INVALID_ACCESS_TOKEN || data.code === ERROR_CODE.INVALID_REFRESH_TOKEN || - data.code === ERROR_CODE.EXPIRED_REFRESH_TOKEN) + data.code === ERROR_CODE.EXPIRED_REFRESH_TOKEN || + data.code === ERROR_CODE.INVALID_TOKEN_VALIDATE || + data.code === ERROR_CODE.NULL_REFRESH_TOKEN) ) { + localStorage.removeItem(ACCESS_TOKEN_KEY); + throw new HTTPError(status, data.message, data.code); } diff --git a/frontend/src/constants/api.ts b/frontend/src/constants/api.ts index 37092ccc3..2b2df76e2 100644 --- a/frontend/src/constants/api.ts +++ b/frontend/src/constants/api.ts @@ -48,6 +48,8 @@ export const ERROR_CODE = { INVALID_ACCESS_TOKEN: 9102, EXPIRED_REFRESH_TOKEN: 9103, EXPIRED_ACCESS_TOKEN: 9104, + INVALID_TOKEN_VALIDATE: 9105, + NULL_REFRESH_TOKEN: 9106, } as const; export const HTTP_ERROR_MESSAGE = {