diff --git a/src/routes/admin.ts b/src/routes/admin.ts index bbc5e89..32ed408 100644 --- a/src/routes/admin.ts +++ b/src/routes/admin.ts @@ -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 })) }; + })