Skip to content

fix: allow delegated admin panel access#91

Merged
danny-avila merged 2 commits into
mainfrom
danny-avila/fix-access-admin-capability-login
Jun 24, 2026
Merged

fix: allow delegated admin panel access#91
danny-avila merged 2 commits into
mainfrom
danny-avila/fix-access-admin-capability-login

Conversation

@danny-avila

Copy link
Copy Markdown
Contributor

Summary

I fixed delegated admin access in the admin panel by removing stale local SystemRoles.ADMIN vetoes after the LibreChat backend has already authorized the admin flow.

LibreChat code references:

  • LibreChat imports the capability middleware and defines admin access as requireCapability(SystemCapabilities.ACCESS_ADMIN) in api/server/routes/admin/auth.js.
  • The local admin login and session verify routes use that requireAdminAccess middleware before returning successful admin responses in api/server/routes/admin/auth.js.
  • The admin OAuth refresh path checks hasCapability(..., SystemCapabilities.ACCESS_ADMIN) before minting a refreshed bearer in api/server/routes/admin/auth.js.
  • The refresh helper documents that admin bearer refresh must fail when the resolved user no longer holds ACCESS_ADMIN in packages/api/src/auth/refresh.ts.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

  • bun run test src/server/auth.oauth.test.ts
  • eslint src/server/auth.ts src/server/auth.oauth.test.ts
  • prettier --check src/server/auth.ts src/server/auth.oauth.test.ts
  • bun run build

Test Configuration:

  • Bun 1.3.13
  • Vitest 4.1.9
  • Node.js v24.16.0

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Copy link
Copy Markdown
Contributor Author

@codex review

@danny-avila danny-avila marked this pull request as ready for review June 24, 2026 20:24

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 411b0ea414

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/server/auth.ts

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: e79e10dd08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila danny-avila merged commit b28ca83 into main Jun 24, 2026
4 checks passed
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.

Admin panel access is hard-coded to the ADMIN role, ignoring the access:admin capability — delegated sub-admins can't log in

2 participants