Cap icon indicating copy to clipboard operation
Cap copied to clipboard

Restricted share page has no way back to the video after sign-in

Open ghost opened this issue 3 months ago • 4 comments

Bug

On a restricted share page (/s/{videoId} with email_restriction_login_required or a private video), PolicyDeniedView tells the viewer to sign in. The inline link goes to /login with no next. After Google OAuth they land on /dashboard and have to find the original tab and refresh.

On older images the copy is plain text with no link at all.

Expected

Sign in from the denied page should return to /s/{videoId}. /login?next= already does this (apps/web/app/(org)/login/form.tsx + getSafeNextPath). Share-page comment overlay already passes callbackUrl back to the video. The access-denied view does not.

Fix

PR incoming: pass videoId into PolicyDeniedView, link to /login?next=/s/{videoId}, and add a visible Sign in button. Leave email_restriction_denied as copy-only (they are already signed in; the domain is wrong).

ghost avatar Sep 02 '26 20:09 ghost

CAP-800

linear[bot] avatar Sep 02 '26 20:09 linear[bot]

Submitted fix in PR #2287. Passes videoId to PolicyDeniedView, routes authentication through /login?next=/s/{videoId}, adds the prominent Sign in button, keeps email_restriction_denied copy-only, and adds unit test suite.

massmarketconsumer-arch avatar Sep 12 '26 20:09 massmarketconsumer-arch

This looks fixed on main since #2306. Every denied state on the share page now signs in with a next param back to the video:

apps/web/app/s/[videoId]/_components/AccessStates.tsx:18-24

const accessUrls = (videoId: Video.VideoId) => {
	const next = encodeURIComponent(`/s/${videoId}`);
	return {
		login: `/login?next=${next}`,
		signup: `/signup?next=${next}`,
	};
};

SignInRequiredState (email_restriction_login_required) uses it for its sign-in button, PrivateVideoState for its sign-in and switch-account links, and AccessRestrictedState (email_restriction_denied) for its switch-account button. PolicyDeniedView in page.tsx picks between them. Looks closeable.

patrickballard avatar Oct 25 '26 12:10 patrickballard

This was fixed in #2306, every sign in link on a restricted share page now returns you to the video. It's live on Cap.so, so closing, but reopen if you still see it.

richiemcilroy avatar Nov 04 '26 16:11 richiemcilroy