From 2dccacd9fb365b28d388307e5d00e3d0b4c036ee Mon Sep 17 00:00:00 2001 From: stefano-dts Date: Wed, 2 Sep 2026 16:46:54 -0400 Subject: [PATCH] fix(web): return restricted share viewers to the video after sign-in PolicyDeniedView linked to /login with no next, so Google OAuth dumped viewers on /dashboard. Honor Cap's existing ?next= and add a Sign in button so the CTA is not buried in gray body copy. Co-authored-by: Cursor --- apps/web/app/s/[videoId]/page.tsx | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx index b1ac888798..8c55f63c46 100644 --- a/apps/web/app/s/[videoId]/page.tsx +++ b/apps/web/app/s/[videoId]/page.tsx @@ -166,12 +166,19 @@ async function getSharedSpacesForVideo(videoId: Video.VideoId) { return sharedSpaces; } -function PolicyDeniedView({ reason }: { reason?: string }) { +function PolicyDeniedView({ + reason, + videoId, +}: { + reason?: string; + videoId: string; +}) { + const loginHref = `/login?next=/s/${videoId}`; let title = "This video is private"; let description: React.ReactNode = ( <> - If you own this video, please sign in to manage - sharing. + If you own this video, please sign in to + manage sharing. ); @@ -180,7 +187,7 @@ function PolicyDeniedView({ reason }: { reason?: string }) { description = ( <> The owner of this video has restricted access. Please{" "} - sign in with an authorized email address to + sign in with an authorized email address to view. ); @@ -195,12 +202,22 @@ function PolicyDeniedView({ reason }: { reason?: string }) {

{title}

{description}

+ {reason !== "email_restriction_denied" ? ( + + Sign in + + ) : null} ); } const renderPolicyDenied = (videoId: Video.VideoId, reason?: string) => - Effect.succeed(); + Effect.succeed( + , + ); const renderNoSuchElement = (awaitRecording: boolean) => awaitRecording