Skip to content

Block admin access during maintenance - #9

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/block-admin-during-maintenance-d225
Aug 13, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/block-admin-during-maintenance-d225

Conversation

@iamroidev

Copy link
Copy Markdown
Owner

Summary

Removes the admin bypass during maintenance. When the site is locked, nobody can access it — including admins.

Changes

  • Removed Admin link from maintenance page
  • Admin login modal and /admin route no longer accessible during maintenance
  • Stored admin/nominee sessions cleared and not restored on load
  • Backend no longer exempts /api/admin/* routes during maintenance

To restore access

Set siteLocked: false in frontend/src/branding.js and SITE_MAINTENANCE=false in Render.

Open in Web Open in Cursor 

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>
Copilot AI lite review requested due to automatic review settings August 13, 2026 14:45
@vercel

vercel Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
voteeq Ready Ready Preview Aug 13, 2026 2:45pm

@cursor
cursor Bot merged commit 5beb2e8 into main Aug 13, 2026
1 of 2 checks passed
@cursor
cursor Bot deleted the cursor/block-admin-during-maintenance-d225 branch August 13, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /admin during 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 thread frontend/src/App.jsx
Comment on lines +283 to 287
if (authNominee || authAdmin) {
clearAllSessions();
} else {
resetPublicUrl();
}

This branch was successfully deployed

1 active deployment
Preview — 86ae2e2f Deployed Aug 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants