refactor(routing): move control panel to /dashboard, add public landing at / - #43
Conversation
054051e to
df2db88
Compare
|
Warning Review limit reached
Next review available in: 45 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: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
WalkthroughAll internal navigation routes are migrated from root-level paths ( ChangesRoute migration to /dashboard prefix and new landing page
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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.
🧹 Nitpick comments (1)
apps/web/src/app/dashboard/layout.tsx (1)
11-16: 🔒 Security & Privacy | 🔵 TrivialShip the Cloudflare Access destination update with this route move.
This layout now assumes
/dashboardand/api/trpc/*are gated while/stays public. If the Access app destinations are not updated in the same rollout, the control panel becomes publicly reachable.🤖 Prompt for 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. In `@apps/web/src/app/dashboard/layout.tsx` around lines 11 - 16, The route move in the dashboard layout assumes Cloudflare Access is already updated, so make sure the Access app destination list is changed in the same rollout. Update the gating configuration to cover the new /dashboard and /api/trpc/* paths while keeping / public, and verify the rollout alongside the dashboard layout changes so the control panel does not become publicly reachable.
🤖 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.
Nitpick comments:
In `@apps/web/src/app/dashboard/layout.tsx`:
- Around line 11-16: The route move in the dashboard layout assumes Cloudflare
Access is already updated, so make sure the Access app destination list is
changed in the same rollout. Update the gating configuration to cover the new
/dashboard and /api/trpc/* paths while keeping / public, and verify the rollout
alongside the dashboard layout changes so the control panel does not become
publicly reachable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ece6f512-5673-4261-903c-67f949694c88
📒 Files selected for processing (12)
apps/web/src/app/dashboard/giveaways/page.tsxapps/web/src/app/dashboard/layout.tsxapps/web/src/app/dashboard/page.tsxapps/web/src/app/dashboard/settings/backup/page.tsxapps/web/src/app/dashboard/settings/layout.tsxapps/web/src/app/dashboard/settings/overlays/page.tsxapps/web/src/app/dashboard/settings/page.tsxapps/web/src/app/dashboard/settings/twitch/page.tsxapps/web/src/app/dashboard/timer/page.tsxapps/web/src/app/page.tsxapps/web/src/components/control/rewards-tab.tsxapps/web/src/components/control/timer-tab.tsx
…ng at / Cloudflare Access can only gate by destination path, not bypass sub-paths. Panel routes lived at the root, forcing Access to gate / with no clean way to keep /overlay (OBS token-gated) and /api/twitch/callback public. Move the operator panel under /dashboard so Access gates exactly /dashboard, /dashboard/*, /api/trpc/*. Add a public landing page at /. Overlays (/overlay/*) and the Twitch callback stay public and untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
df2db88 to
a6f4858
Compare
Why
Cloudflare Access gates by destination path and has no per-sub-path bypass. The operator panel lived at the root (
/,/timer,/giveaways,/settings/*), which forced Access to gate/while we needed/overlay/*(OBS token-gated) and/api/twitch/callbackto stay public. That can't be expressed cleanly within the 5-destination limit.What
(panel)→dashboard, so all operator routes now live under/dashboard/*./with a link into the dashboard.dashboard/layout.tsx,dashboard/settings/layout.tsx) and the overlay-settings links inrewards-tab.tsx/timer-tab.tsx.Auth model after this change
//dashboard,/dashboard/*/api/trpc/*/overlay/*?t=token (unchanged)/api/twitch/callbackOverlays and the Twitch callback are untouched — OBS URLs still point at
/overlay/*?t=…, no re-copy needed.Ops follow-up (deploy + Access must move together)
Update the Cloudflare Access app destinations to:⚠️ If code deploys while Access still gates
dashboard,dashboard/*,api/trpc/*.control,/dashboardis ungated. Update Access alongside the deploy.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes