Unify homepage for guest/user; restore my-collections at /collections - #28
Conversation
The homepage no longer branches on auth state - the landing page (hero, highlights, published-collections showcase) is shown to everyone, with the sign up/log in CTAs hidden once logged in. The user's own collections list moves back to /collections (auth-gated, as it was before being folded into "/"), and every place that used to treat "/" as the logged-in user's home (login/signup success, guest middleware, sanitizeRedirect's fallback) now points at /collections instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe homepage now serves published collections to all visitors. Authenticated users access ChangesAuthenticated collections flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Visitor
participant GuestMiddleware
participant CollectionsPage
participant CollectionsList
Visitor->>GuestMiddleware: request authenticated destination
GuestMiddleware->>CollectionsPage: redirect to /collections
CollectionsPage->>CollectionsList: render collection list
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/features/login/model/use-login-form.ts`:
- Around line 5-14: Update sanitizeRedirect to reject same-origin URLs whose
url.pathname starts with "//" before constructing the sanitized return value,
falling back to "/collections"; preserve the existing handling for valid
same-origin paths, external URLs, and invalid candidates.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ba07c282-d377-4eab-ade4-cad80f9a995c
📒 Files selected for processing (15)
app/features/auth-buttons/ui/auth-buttons.vueapp/features/collection-form/model/__tests__/use-collection-form.test.tsapp/features/collection-form/model/use-collection-form.tsapp/features/home-landing/index.tsapp/features/home-landing/model/use-landing-hero.tsapp/features/home-landing/ui/landing-hero.vueapp/features/login/model/__tests__/use-login-form.test.tsapp/features/login/model/use-login-form.tsapp/features/signup/model/__tests__/use-signup-form.test.tsapp/features/signup/model/use-signup-form.tsapp/middleware/guest.tsapp/pages/collections/index.vueapp/pages/index.vuei18n/locales/en.jsoni18n/locales/ru.json
A same-origin URL like "https://<origin>//evil.com/phish" passed the
origin check but its pathname ("//evil.com/phish") is itself
protocol-relative - Nuxt's navigateTo treats that as an external
destination via hasProtocol(..., { acceptRelative: true }), aborting
post-login navigation instead of falling back to /collections.
Found by CodeRabbit on PR #28.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
useLandingHero() (added in PR #28's homepage unification) had no test coverage. Add app/shared/testing/mocks/use-auth.ts to mock the useAuth() factory the same way auth-client.ts mocks the authClient singleton, then cover useLandingHero's loggedIn derivation for a present session and for null/undefined session data. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
/is now a single homepage shown to both guests and logged-in users (landing hero + highlights + published-collections showcase), instead of branching into a guest landing page vs. the user's own collections list.useLandingHeroinfeatures/home-landing/model/)./collections(auth-gated via the existingauthmiddleware, restoring its pre-merge location), rendering the already-existingCollectionsListcomponent.AuthButtonsgains a "My Collections" nav link, visible only when logged in."/"as the logged-in user's home now points at/collectionsinstead: post-login redirect (sanitizeRedirect's no-?redirect=fallback), post-signup redirect, theguestmiddleware (already-logged-in users hitting/login//signup), and the collection-edit success redirect.Test plan
pnpm type-checkpnpm lintpnpm test(341 passed; updated redirect-target assertions inuse-login-form,use-signup-form,use-collection-formtests)pnpm dev):/shows landing page with CTAs + showcase; guest/collectionsredirects to/login?redirect=/collections/collections/shows landing page without CTAs; header shows "My Collections"; logged-in/loginredirects to/collections🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes