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
@@ -16,6 +16,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { VideoCard } from '@/components/video-card';
import { GuestGate } from '@/components/guest-gate';
import { auth } from '@/lib/auth';
import { db } from '@/lib/db';
@@ -135,7 +136,55 @@ export default async function ProjectPage({ params }: ProjectPageProps) {
});
const canEdit = isOwner || project.members[0]?.role === 'ADMIN' || workspaceRole === 'OWNER' || workspaceRole === 'ADMIN';
const isAuthenticated = !!session?.user?.id;
// Guest name gate for unauthenticated users on public projects
if (!isAuthenticated && isPublic) {
return (
<GuestGate>
<ProjectContent
project={project}
projectId={projectId}
videos={videos}
canEdit={false}
isOwner={false}
isPublic={isPublic}
workspaceRole={null}
/>
</GuestGate>
);
}
return (
<ProjectContent
project={project}
projectId={projectId}
videos={videos}
canEdit={canEdit}
isOwner={isOwner}
isPublic={isPublic}
workspaceRole={workspaceRole}
/>
);
}
function ProjectContent({
project,
projectId,
videos,
canEdit,
isOwner,
isPublic,
workspaceRole,
}: {
project: { name: string; description: string | null; visibility: string; workspace: { id: string; name: string } | null; members: { role: string }[] };
projectId: string;
videos: { id: string; title: string; thumbnailUrl: string; currentVersion: number; commentCount: number; duration: string; lastUpdated: string }[];
canEdit: boolean;
isOwner: boolean;
isPublic: boolean;
workspaceRole: string | null;
}) {
return (
<div className="px-6 lg:px-8 py-8 w-full">
{/* Back link */}