Skip to content

Implement Admin Page - #133

Merged
Arsh-S merged 7 commits into
mainfrom
admin-paeg
Oct 27, 2026
Merged

Arsh-S merged 7 commits into
mainfrom
admin-paeg

Conversation

@Shengle-Dai

@Shengle-Dai Shengle-Dai commented Apr 12, 2026 •

Copy link
Copy Markdown
Contributor

Adds a platform admin page at /admin for approving organizations. A new backend admin module provides API endpoints (GET /admin/verify, GET /admin/organizations, POST /admin/organizations/:id/authorize) gated by an authorizeAdmin middleware that checks the authenticated user's email with ADMIN_EMAILS env variable. The frontend admin page displays organizations in a table (Pending/Approved/All) with approve and revoke buttons. Non-admin users are redirected away from the page.

image

@vercel

vercel Bot commented Apr 12, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
curaise Ready Ready Preview Oct 27, 2026 3:22pm UTC

Comment thread backend/src/api/admin/admin.router.ts Outdated
Comment on lines +39 to +41
validate({ params: OrganizationParams, body: UpdateOrganizationAuthorizedBody }),
authenticate,
authorizeAdmin,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reorder the middleware to authenticate, authorizeAdmin, validate to match the other routes and prevent unauthenticated callers from inspecting the body schema.

On the authorize route validate ran ahead of authenticate, so an
unauthenticated caller got a 400 schema error instead of a 401 and could
probe the body shape. Moves it behind both auth middlewares.

ADMIN_EMAILS grants access by address, so authorizeAdmin now also requires
email_confirmed_at. Without it, anyone able to register an admin's address
on a project that allows unverified signup would inherit admin.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Shengle-Dai
❌ Arsh-S
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 788fca21-d983-409d-9979-ca9effd7a61b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Arsh-S
Arsh-S merged commit cf60bf9 into main Oct 27, 2026
4 checks passed
@Arsh-S
Arsh-S deleted the admin-paeg branch October 27, 2026 15:22

This branch was successfully deployed

1 active deployment
Preview — 7b5db62e Deployed Oct 27, 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