Remove bootstrap-admin endpoint

This commit is contained in:
2026-01-28 17:19:17 +00:00
parent d346f90793
commit 8efb0bee1d

View File

@@ -415,23 +415,4 @@ export const hammerRoutes = new Elysia({ prefix: '/hammer' })
}),
})
// Bootstrap: promote a user to admin (one-time setup helper)
.post('/bootstrap-admin', async ({ body, set }) => {
const user = await db.query.users.findFirst({
where: eq(users.email, body.email),
});
if (!user) {
set.status = 404;
throw new Error('User not found');
}
const [updated] = await db
.update(users)
.set({ role: 'admin' })
.where(eq(users.email, body.email))
.returning();
return { success: true, user: { id: updated.id, name: updated.name, email: updated.email, role: updated.role } };
}, {
body: t.Object({
email: t.String({ format: 'email' }),
}),
});
;