Skip to content

Refactor AdminGuard to use JWT role claims and remove per-request user lookup - #1

Merged
d3vobed merged 1 commit into
mainfrom
copilot/fix-admin-guard-prisma-requests
Jun 18, 2026
Merged

Refactor AdminGuard to use JWT role claims and remove per-request user lookup#1
d3vobed merged 1 commit into
mainfrom
copilot/fix-admin-guard-prisma-requests

Conversation

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown

AdminGuard was performing a prisma.userFindUnique on every protected request to re-check admin role, adding avoidable DB latency on hot admin paths. Since auth already establishes identity and role at token issuance, role verification can be handled from the JWT-backed request context.

Closes OrbitChainLabs#10

Copilot AI changed the title Refactor AdminGuard to use JWT role and remove DB lookup Refactor AdminGuard to use JWT role claims and remove per-request user lookup Jun 18, 2026
Copilot AI requested a review from d3vobed June 18, 2026 20:34
@d3vobed
d3vobed marked this pull request as ready for review June 18, 2026 20:38
@d3vobed
d3vobed merged commit 6838fdc into main Jun 18, 2026
@d3vobed
d3vobed deleted the copilot/fix-admin-guard-prisma-requests branch June 27, 2026 01:57
@d3vobed
d3vobed restored the copilot/fix-admin-guard-prisma-requests branch July 1, 2026 17:24
@d3vobed
d3vobed deleted the copilot/fix-admin-guard-prisma-requests branch July 1, 2026 17:24
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.

[MEDIUM] — AdminGuard issues a fresh prisma.user.findUnique on every protected request instead of caching role lookups

2 participants