fix(admin): allow fetching current user without elevated ACL (#3)

This commit is contained in:
hampus-fluxer authored and GitHub committed 2026-01-03 00:47:06 +01:00
1 parent b997d3b263
commit 275126d61b
2 files changed
+47 -1

No files matched your search

@@ -36,6 +36,7 @@ import {
ListUserGuildsRequest,
ListUserSessionsRequest,
LookupUserRequest,
mapUserToAdminResponse,
ScheduleAccountDeletionRequest,
SendPasswordResetRequest,
SetUserAclsRequest,
@@ -50,6 +51,14 @@ import {
} from '../AdminModel';
export const UserAdminController = (app: HonoApp) => {
app.get('/admin/users/me', requireAdminACL(AdminACLs.AUTHENTICATE), async (ctx) => {
const adminUser = ctx.get('user');
const cacheService = ctx.get('cacheService');
return ctx.json({
user: await mapUserToAdminResponse(adminUser, cacheService),
});
});
app.post(
'/admin/users/lookup',
RateLimitMiddleware(RateLimitConfigs.ADMIN_LOOKUP),