temp: debug endpoint for user account inspection

This commit is contained in:
2026-01-28 22:00:58 +00:00
parent 8abad1a242
commit ac1495a953

View File

@@ -159,3 +159,13 @@ 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 })) };
})