Phase 12: Initial Setup Wizard #22
@@ -275,6 +275,9 @@ setupRouter.post('/credential', zValidator('json', credentialSchema, noEchoHook)
|
|||||||
.limit(1);
|
.limit(1);
|
||||||
|
|
||||||
if (!localUser) {
|
if (!localUser) {
|
||||||
|
// Clean up the just-inserted user row to avoid an orphaned unclaimed admin
|
||||||
|
// (WR-01: the catch block below does not cover this early-return path).
|
||||||
|
await db.delete(users).where(eq(users.id, inserted.id));
|
||||||
return c.json({ error: 'Service unavailable' }, 503);
|
return c.json({ error: 'Service unavailable' }, 503);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user