Skip to content

Commit 5539e63

Browse files
committed
fix: cookie 넣도록 변경
1 parent 6c438cf commit 5539e63

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

apps/ticket/src/app/api/reissue/route.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
import { cookies } from "next/headers";
12
import { NextResponse } from "next/server";
23

34
import { API_URL } from "@/data/constants";
45

56
export 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
);

apps/ticket/src/shared/components/AuthErrorFallback/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)