diff --git a/src/app/api/auth/kakao/route.ts b/src/app/api/auth/kakao/route.ts index 034b61f..d102a7a 100644 --- a/src/app/api/auth/kakao/route.ts +++ b/src/app/api/auth/kakao/route.ts @@ -26,18 +26,18 @@ export async function POST(req: NextRequest) { return NextResponse.json(data, { status: response.status }); } - const member = data.member; - const refreshToken = data; - const res = NextResponse.json({ member }); // 클라이언트가 받아서 zustand에 저장하도록 + const { member, refreshToken } = data; + + const res = NextResponse.json({ member }); // refreshToken을 httpOnly 쿠키에 저장 - if (refreshToken) { + if (refreshToken && typeof refreshToken === "string") { res.cookies.set("refreshToken", refreshToken, { httpOnly: true, secure: process.env.NODE_ENV === "production", sameSite: "strict", path: "/", - maxAge: 60 * 60 * 24 * 7, // 7일 -> 7일 지나면 재로그인 필요 + maxAge: 60 * 60 * 24 * 7, }); } diff --git a/src/components/record-detail/video-card.tsx b/src/components/record-detail/video-card.tsx index 7f094b9..f3de62e 100644 --- a/src/components/record-detail/video-card.tsx +++ b/src/components/record-detail/video-card.tsx @@ -7,6 +7,7 @@ interface VideoCardProps { } export default function VideoCard({ videoUrl, onDeleteClick }: VideoCardProps) { + console.log(videoUrl); const handleDownloadVideo = async () => { try { // S3 URL에서 영상 다운로드, 브라우저가 이 주소로 가서 파일을 다운로드 받는 것! @@ -21,7 +22,7 @@ export default function VideoCard({ videoUrl, onDeleteClick }: VideoCardProps) { link.href = blobUrl; // 파일명 추출 (URL에서) 또는 기본 파일명 사용 - const fileName = videoUrl.split("/").pop() || "video.mp4"; + const fileName = videoUrl.split("/").pop()?.split("?")[0] || "video.mp4"; link.download = fileName; // 다운로드 트리거 @@ -61,11 +62,13 @@ export default function VideoCard({ videoUrl, onDeleteClick }: VideoCardProps) {
-
);