log every auth attempt that names an identity the platform does not know

This commit is contained in:
2026-08-06 05:31:10 +00:00
parent b6b9b01aa6
commit 1eb2140f95
6 changed files with 245 additions and 2 deletions
+5
View File
@@ -2,6 +2,7 @@ import type { Handler } from 'hono';
import { getUserCount, createUser } from 'officerdb';
import argon2 from 'argon2';
import * as errors from '@@/custom-errors';
import { rememberUser } from '@@/_middlewares';
import { validatePassword } from './validate-password';
import { validateUsername } from './validate-username';
@@ -43,5 +44,9 @@ export const bootstrapHandler: Handler = async function (ctx) {
role: 'Super Admin',
});
// The launch-time snapshot was taken while the user table was still empty. Without this the owner's
// very first sign-in would be filed as an unknown identity.
rememberUser(user);
return ctx.json({ ok: true });
};