Revert "temp: debug endpoint for user account inspection"
This reverts commit ac1495a953.
This commit is contained in:
@@ -159,13 +159,3 @@ export const adminRoutes = new Elysia({ prefix: '/admin' })
|
||||
}, {
|
||||
params: t.Object({ id: t.String() }),
|
||||
});
|
||||
|
||||
// Temporary debug - check user account records
|
||||
.get('/debug/user/:email', async ({ params, user, set }: { params: { email: string }; user: any; set: any }) => {
|
||||
if (user.role !== 'admin') { set.status = 403; throw new Error('Forbidden'); }
|
||||
const { eq } = await import('drizzle-orm');
|
||||
const [u] = await db.select().from(users).where(eq(users.email, params.email)).limit(1);
|
||||
if (!u) return { error: 'User not found' };
|
||||
const accts = await db.select().from(accounts).where(eq(accounts.userId, u.id));
|
||||
return { user: { ...u }, accounts: accts.map(a => ({ ...a, password: a.password ? '[REDACTED]' : null })) };
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user