You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(plugin-auth): password history / no-reuse (ADR-0069 D1, P1) (#2371)
Adds `password_history_count` (0-24, 0=off) auth setting. On /change-password
and /reset-password a new password matching the current password or any of the
last N hashes is rejected with PASSWORD_REUSE. A bounded
`sys_account.previous_password_hashes` JSON ring (system-managed, hidden) backs
the check, maintained by before/after hooks (capture old hash, append on
success).
Reuses better-auth's native `password.verify` (no bespoke crypto) and resolves
the reset-flow user via better-auth's own reset-token verification lookup.
Default-off / additive (no upgrade behavior change); ADR-0049 (enforcement ships
with the setting).
Verified live (dogfood, history_count=3): change P1->P2 ok; change back to P1
(historical) -> 400 PASSWORD_REUSE; change P2->P2 (current) -> 400
PASSWORD_REUSE; change to a fresh password ok; the ring column persists bounded
real hashes. Unit: 135 plugin-auth (incl. parse/reuse/ring helpers with a stub
verify + where-aware sys_account mock) + service-settings + platform-objects
green; builds incl. strict DTS green.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Auth: password history / no-reuse (ADR-0069 D1, P1)
8
+
9
+
Adds `password_history_count` (0–24, 0 = off) to the `auth` password-policy settings. On `/change-password` and `/reset-password`, a new password that matches the current password or any of the last N hashes is rejected with `PASSWORD_REUSE`. A new bounded `sys_account.previous_password_hashes` column (JSON ring, system-managed, hidden) backs the check; it is maintained by before/after hooks (capture the old hash, append on success).
10
+
11
+
Reuses better-auth's native `password.verify` (no bespoke crypto) and resolves the reset-flow user via the same token lookup better-auth uses. Default-off / additive (no upgrade behavior change); per ADR-0049 the setting ships with its enforcement.
0 commit comments