feat(share): add video-level secure share links with password unlock and session-based watch/comment access

This commit is contained in:
Yusuf İpek
2026-02-23 17:11:32 +03:00
parent d15e5192ac
commit 9058317247
16 changed files with 1253 additions and 46 deletions
+20 -13
View File
@@ -1,16 +1,23 @@
'use client';
import { useParams } from 'next/navigation';
import { VideoPageContent } from '@/components/video-page-content';
import { ShareLinkBootstrap } from '@/components/share-link-bootstrap';
import { ShareLinkUnlock } from '@/components/share-link-unlock';
export default function WatchPage() {
const params = useParams();
const videoId = params.videoId as string;
return (
<VideoPageContent
mode="watch"
videoId={videoId}
/>
);
interface WatchPageProps {
params: Promise<{ videoId: string }>;
searchParams: Promise<{ shareToken?: string; unlock?: string }>;
}
export default async function WatchPage({ params, searchParams }: WatchPageProps) {
const { videoId } = await params;
const { shareToken, unlock } = await searchParams;
if (typeof shareToken === 'string' && shareToken.length > 0) {
return <ShareLinkBootstrap videoId={videoId} shareToken={shareToken} />;
}
if (unlock === '1') {
return <ShareLinkUnlock videoId={videoId} />;
}
return <VideoPageContent mode="watch" videoId={videoId} />;
}