File tree Expand file tree Collapse file tree
shared/components/AuthErrorFallback Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { cookies } from "next/headers" ;
12import { NextResponse } from "next/server" ;
23
34import { API_URL } from "@/data/constants" ;
45
56export async function POST ( req : Request ) {
7+ const cookiesStore = await cookies ( ) ;
8+
69 const apiRes = await fetch (
710 process . env . NEXT_PUBLIC_TICKET_API_BASE_URL + API_URL . USER . REISSUE_ACCESS_TOKEN ,
811 {
912 method : "POST" ,
10- headers : { "Content-Type" : "application/json" } ,
13+ headers : {
14+ "Content-Type" : "application/json" ,
15+ Cookie : `accessToken=${ cookiesStore . get ( "accessToken" ) ?. value } ; refreshToken=${ cookiesStore . get ( "refreshToken" ) ?. value } ` ,
16+ } ,
1117 credentials : "include" ,
1218 } ,
1319 ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export const AuthErrorFallback = () => {
1717 credentials : "include" ,
1818 } ) ;
1919
20- console . log ( "@@ reissue" , res , JSON . stringify ( res ) ) ;
20+ console . log ( "@@ reissue" , res ) ;
2121
2222 // 토큰 재발급 후 reload()
2323 // window.location.reload();
You can’t perform that action at this time.
0 commit comments