Skip to content

Commit

Permalink
refactor: 리프레시 토큰 만료시 리다이렉트 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeHongDev committed Jul 6, 2024
1 parent d9691d4 commit 32742a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/api/Interceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const handleTokenError = async(error: AxiosError<ErrorResponseData>) => {

const { data, status } = error.response;

if (status === 401 && data.code === 10003){
if (status === 400 && data.code === 10003){
const { accessToken } = await reIssueToken();
originalRequest.headers.Authorization = TOKEN.bearer(accessToken);
localStorage.setItem(TOKEN.ACCESS, accessToken);
Expand All @@ -46,7 +46,7 @@ export const handleTokenError = async(error: AxiosError<ErrorResponseData>) => {
}

if (
status === 401 && data.code >= 10000
status === 400 && (data.code >= 10000 || data.code <= 10006)
) {
localStorage.removeItem(TOKEN.ACCESS);
window.location.href = PATH.AUTH;
Expand Down

0 comments on commit 32742a0

Please sign in to comment.