Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/app/api/auth/kakao/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand Down
15 changes: 9 additions & 6 deletions src/components/record-detail/video-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface VideoCardProps {
}

export default function VideoCard({ videoUrl, onDeleteClick }: VideoCardProps) {
console.log(videoUrl);
const handleDownloadVideo = async () => {
try {
// S3 URL에서 영상 다운로드, 브라우저가 이 주소로 가서 파일을 다운로드 받는 것!
Expand All @@ -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;

// 다운로드 트리거
Expand Down Expand Up @@ -61,11 +62,13 @@ export default function VideoCard({ videoUrl, onDeleteClick }: VideoCardProps) {
</div>
<div className="border-t border-gray-300" />
<div className="p-4">
<video
className="w-full h-120 rounded-[15px]"
src={videoUrl}
controls
/>
{videoUrl && (
<video
className="w-full h-120 rounded-[15px]"
src={videoUrl}
controls
/>
)}
</div>
</CardLayout>
);
Expand Down