fix: remove admin from sidebar + add PATCH to CORS#274
Conversation
|
@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe Admin page route is relocated from the Dashboard component to a standalone /admin route in the main App component, protected by authentication middleware. The Sidebar's Admin navigation link is removed. Backend CORS middleware is updated to allow PATCH requests, and AdminPage query retries are disabled. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
bcc3085 to
7654641
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/vercel.json`:
- Around line 9-13: The rewrite rule in vercel.json using "source": "/(.*)" with
"has": [{"type":"host","value":"admin.opencodeintel.com"}] currently rewrites to
"/admin", which preserves the browser pathname and prevents React Router
BrowserRouter from seeing "/admin"; change the rule so its "destination" points
to "/index.html" (so the SPA can handle routing) or convert it to a 3xx redirect
that changes the browser URL to "/admin" instead—update the rule that contains
"source", "has" and "destination" accordingly.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
backend/main.pyfrontend/src/App.tsxfrontend/src/components/Dashboard.tsxfrontend/src/components/dashboard/Sidebar.tsxfrontend/src/pages/AdminPage.tsxfrontend/vercel.json
💤 Files with no reviewable changes (2)
- frontend/src/components/Dashboard.tsx
- frontend/src/components/dashboard/Sidebar.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- backend/main.py
Admin completely removed from user dashboard: - Removed from Dashboard.tsx (no /dashboard/admin route) - Removed from Sidebar.tsx (no admin link, no Shield icon) - Zero admin traces in any user-facing component Admin is now a standalone route: - /admin in App.tsx -- no DashboardLayout, no sidebar, no topnav - ProtectedRoute wraps it (must be logged in) - Backend 403 enforces ADMIN_EMAILS check - retry:false prevents non-admins from hammering 403 Vercel rewrite added: - admin.opencodeintel.com -> /admin (add domain in Vercel dashboard) Also: PATCH added to CORS allow_methods for tier update endpoint.
7654641 to
10fb80d
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Hotfix for two issues found in production after PR #273 merge:
3 files, 2 insertions, 3 deletions.
Summary by CodeRabbit
Release Notes
New Features
Changes