Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] 선행 401 상태코드 체크 라인 제거 #226

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/utils/CommonAxios/CommonAxios.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { JWT_COOKIE_NAME } from "@/constants/Auth";
import axios from "axios";
import Cookies from "js-cookie";
import { redirect } from "next/navigation";

/**
* 클라이언트에서 사용하는 공통 axios
Expand All @@ -19,10 +18,10 @@ CommonAxios.interceptors.response.use(
},
async function (error) {
// 401: 인증 실패 → 로그인 페이지(또는 메인)로 리다이렉트
if (error.response?.status === 401) {
redirect("/");
return Promise.reject(error);
}
// if (error.response?.status === 401) {
// redirect("/");
// return Promise.reject(error);
// }

// 특정 에러 코드(4002, 3001)로 로그아웃이 필요한 상황

Expand Down
Loading