Skip to content

Commit 884dfdf

Browse files
authored
fix : axios 헤더 csrf 토큰 제거 (#111)
2 parents 898b15b + a7adc60 commit 884dfdf

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/app/api/axios.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import axios from "axios";
2-
import nookies from "nookies";
32
import { v4 as uuidv4 } from "uuid";
43

54
export const instance = axios.create({
@@ -12,18 +11,14 @@ instance.interceptors.request.use(
1211
(config) => {
1312
// 브라우저 환경에서만 쿠키 읽기
1413
if (typeof window !== "undefined") {
15-
const cookies = nookies.get();
16-
const csrftoken = cookies.csrfToken;
1714
const deviceId = localStorage.getItem("device-id") || uuidv4();
1815
if (!localStorage.getItem("device-id")) {
1916
localStorage.setItem("device-id", deviceId);
2017
}
2118

22-
if (csrftoken) {
23-
config.headers["X-CSRF-TOKEN"] = csrftoken;
24-
config.headers["Device-Id"] = deviceId;
25-
}
19+
config.headers["Device-Id"] = deviceId;
2620
}
21+
console.log("Request Config:", config);
2722
return config;
2823
},
2924
(error) => Promise.reject(error),

0 commit comments

Comments
 (0)