File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import axios from "axios" ;
2- import nookies from "nookies" ;
32import { v4 as uuidv4 } from "uuid" ;
43
54export 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 ) ,
You can’t perform that action at this time.
0 commit comments