Skip to content

Commit

Permalink
Fix/#32: customStatus 에러코드 E401001로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
imddoy committed Jan 13, 2025
1 parent d3a86fc commit c62f912
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/apis/errorResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface ErrorResponse {
status: number;
status: number | string;
message: string;
}
2 changes: 1 addition & 1 deletion src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ instance.interceptors.response.use(
const httpStatus = error.response?.status; // HTTP 상태 코드
const customStatus = error.response?.data?.status; // 응답의 상태 코드

if (httpStatus === 401 && customStatus === 401001) {
if (httpStatus === 401 && customStatus === 'E401001') {
// 인증 오류 처리 (재로그인)
localStorage.removeItem('user');
window.location.href = '/login';
Expand Down

0 comments on commit c62f912

Please sign in to comment.