Allow anonymous users to read lessons#11
Merged
Merged
Conversation
Drop the redirect that bounced signed-out visitors off lesson pages. The prose and prev/next nav now render for everyone, while interactive pieces stay gated in context: Run/Check buttons become an inline "Sign in" CTA, and the sandbox shows a disabled placeholder with a "Sign in to start the sandbox" button instead of provisioning a Xata branch. All CTAs return to the current lesson after sign-in. Closes #9 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Closes #9.
Signed-out visitors can now open and read any
/lessons/<slug>page instead of being bounced to the landing page. Every interactive action stays gated behind auth, but in context — replaced with a sign-in CTA that returns to the current lesson.app/lessons/[slug]/page.tsx): dropped theif (!session) redirect("/"). Prose + prev/next nav render for everyone; progress lookup is skipped when signed out.RunBlock.tsx,Check.tsx): when signed out, the action button is replaced by an inline "Sign in to run" / "Sign in to check" CTA. AnisSignedInflag + lessoncallbackURLare threaded throughbuildLessonComponents.SandboxSection.tsx+ newSandboxSignInPrompt.tsx): anonymous visitors get a disabled terminal placeholder with a prominent "Sign in to start the sandbox" button —ensureBranchForLessonis not called, so no Xata branch is provisioned.app/sign-in-button.tsx): now takes optionalcallbackURL(default/dashboard), avariant(default|inline), and a custom label viachildren. Existing landing-page usage is unchanged.401guards — no changes there.Test plan
tsc --noEmitandeslintpass.GET /lessons/select-basicsreturns200(no redirect) and renders the prose, "Sign in to run", "Sign in to check", and "Sign in to start the sandbox" CTAs; no▶ Runbutton and no sandbox branch created.🤖 Generated with Claude Code