Skip to content
Open
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
27 changes: 22 additions & 5 deletions apps/web/app/s/[videoId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Link href="/login">sign in</Link> to manage
sharing.
If you own this video, please <Link href={loginHref}>sign in</Link> to
manage sharing.
</>
);

Expand All @@ -180,7 +187,7 @@ function PolicyDeniedView({ reason }: { reason?: string }) {
description = (
<>
The owner of this video has restricted access. Please{" "}
<Link href="/login">sign in</Link> with an authorized email address to
<Link href={loginHref}>sign in</Link> with an authorized email address to
view.
</>
);
Expand All @@ -195,12 +202,22 @@ function PolicyDeniedView({ reason }: { reason?: string }) {
<Logo className="size-32" />
<h1 className="mb-2 text-2xl font-semibold">{title}</h1>
<p className="text-gray-400">{description}</p>
{reason !== "email_restriction_denied" ? (
<Link
href={loginHref}
className="mt-4 inline-flex items-center rounded-full bg-gray-12 px-4 py-2 text-sm font-semibold text-gray-1"
>
Sign in
</Link>
) : null}
Comment on lines +205 to +212

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Misleading Sign In CTA

A signed-in user who lacks access to a private video receives a reasonless policy denial, so this condition still displays the Sign in button. Clicking it redirects the authenticated user back to the same denied video, creating a dead-end CTA.

Knowledge Base Used: Web application routes and components

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/app/s/[videoId]/page.tsx
Line: 205-212

Comment:
**Misleading Sign In CTA**

A signed-in user who lacks access to a private video receives a reasonless policy denial, so this condition still displays the Sign in button. Clicking it redirects the authenticated user back to the same denied video, creating a dead-end CTA.

**Knowledge Base Used:** [Web application routes and components](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/web-application-routes.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

</div>
);
}

const renderPolicyDenied = (videoId: Video.VideoId, reason?: string) =>
Effect.succeed(<PolicyDeniedView key={videoId} reason={reason} />);
Effect.succeed(
<PolicyDeniedView key={videoId} videoId={videoId} reason={reason} />,
);

const renderNoSuchElement = (awaitRecording: boolean) =>
awaitRecording
Expand Down