Block admin access during maintenance - #9
Merged
Merged
Conversation
Remove admin login link, stored admin sessions, /admin route handling, and API exemptions so maintenance mode locks out all users including admins. Co-authored-by: Richard Kwaku Opoku <iamroidev@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR removes the “admin bypass” behavior during maintenance so that when maintenance is active (frontend lock and/or backend maintenance flag), all users—including admins—are blocked from accessing admin UI/routes and admin API endpoints.
Changes:
- Removes the admin entry point from the maintenance page and prevents the admin login modal from rendering during maintenance.
- Updates frontend routing/session behavior to avoid exposing
/adminduring maintenance and to clear sessions when maintenance is active. - Updates backend maintenance middleware to no longer exempt
/api/admin/*endpoints.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/pages/MaintenancePage.jsx | Removes the “Admin” link/action from the maintenance UI. |
| frontend/src/main.jsx | Stops mapping /admin (and /payment-status) into hash routes when siteLocked is enabled; redirects those paths back to /. |
| frontend/src/branding.js | Removes the admin-based exception from isSiteLockedForUser, making lock unconditional. |
| frontend/src/App.jsx | Removes admin maintenance bypass and blocks admin modal/login flow during maintenance; adds session-clearing helpers. |
| backend/server.js | Removes maintenance exemptions for /api/admin/* so maintenance blocks admin API access too. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+283
to
287
| if (authNominee || authAdmin) { | ||
| clearAllSessions(); | ||
| } else { | ||
| resetPublicUrl(); | ||
| } |
This branch was successfully deployed
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
Removes the admin bypass during maintenance. When the site is locked, nobody can access it — including admins.
Changes
/adminroute no longer accessible during maintenance/api/admin/*routes during maintenanceTo restore access
Set
siteLocked: falseinfrontend/src/branding.jsandSITE_MAINTENANCE=falsein Render.