fix(backend): use the strong password generator for resets and enforce must_change_password (#1387)

Admin password reset generated a ~2^21-entropy password from a small
wordlist instead of the already-available generateSecurePassword(16),
and must_change_password was written on reset but never checked by
any route-blocking logic — a reset user could keep using the old
session/password indefinitely.

Co-authored-by: Paul Nothaft <[email protected]>
This commit is contained in:
Paul Nothaft
2026-09-11 10:40:46 +02:00
committed by GitHub
co-authored by Paul Nothaft
parent 59ea83c84e
commit b798d8e4c1
5 changed files with 262 additions and 6 deletions
@@ -64,6 +64,11 @@ beforeAll(async () => {
t.integer('role_id');
t.boolean('is_active');
t.timestamp('password_changed_at');
// adminAuth() now selects this on every request (GHSA-h4w8-57xq-53fx
// must_change_password enforcement) — without the column the join
// throws and every route in this file 401s before reaching the
// permission check it's meant to test.
t.boolean('must_change_password');
});
await mockDb.schema.createTable('permissions', (t) => {
t.increments('id');