fix(web): return restricted share viewers to the video after sign-in - #2193
Open
stefanoNELP wants to merge 1 commit into
Open
fix(web): return restricted share viewers to the video after sign-in#2193stefanoNELP wants to merge 1 commit into
stefanoNELP wants to merge 1 commit into
Conversation
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 <cursoragent@cursor.com>
Comment on lines
+205
to
+212
| {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} |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restricted
/s/{videoId}pages tell the viewer to sign in, then send them to/loginwith nonext. Google OAuth dumps them on/dashboard; they have to refresh the original tab.Login already honors
?next=(getSafeNextPath+LoginForm). This wiresPolicyDeniedViewto/login?next=/s/{videoId}and adds a visible Sign in button so the CTA is not a gray word in the body copy.email_restriction_deniedstays copy-only — those viewers are already signed in.Fixes #2192
Test plan
/s/{videoId}, not/dashboard.This video is private).Made with Cursor
Greptile Summary
The PR adds a safe return path and visible sign-in CTA to restricted share-page denial states so anonymous viewers return to the requested video after authentication.
PolicyDeniedView./login?next=/s/{videoId}for inline and button sign-in links.Confidence Score: 4/5
The PR appears safe to merge, with a non-blocking misleading Sign in CTA for authenticated users who cannot access a private video.
The intended anonymous sign-in return flow is preserved, but reasonless private-video denials do not distinguish signed-in viewers, causing the new CTA to redirect those users back to the same denial.
Files Needing Attention: apps/web/app/s/[videoId]/page.tsx
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(web): return restricted share viewer..." | Re-trigger Greptile
Context used: