feat: Introduce guest access for video viewing, implement user notification settings via email and Telegram, and add rate limiting infrastructure.

This commit is contained in:
Yusuf İpek
2026-02-07 13:56:26 +03:00
parent 296c5257a7
commit 88dcf9514c
17 changed files with 1566 additions and 39 deletions
+13 -1
View File
@@ -53,7 +53,19 @@ export async function GET(request: NextRequest, { params }: RouteParams) {
return NextResponse.json({ error: 'Access denied' }, { status: 403 });
}
return NextResponse.json(video);
// Include auth context so the client knows if the viewer is a guest
const { project, ...videoData } = video;
return NextResponse.json({
...videoData,
projectId: video.projectId,
project: {
name: project.name,
ownerId: project.ownerId,
visibility: project.visibility,
},
isAuthenticated: !!session?.user?.id,
canComment: isOwner || isMember || isPublic,
});
} catch (error) {
console.error('Error fetching video:', error);
return NextResponse.json(