Files
romm/backend/tests/handler/auth
Georges-Antoine Assi 866d95640f fix(auth): check a dummy hash when the username is unknown (#5633)
* fix(auth): check a dummy hash when the username is unknown

Password sign-in skipped bcrypt for usernames with no account, so a
failed login answered far faster for an unknown name than for a real one.
Verify against a throwaway hash in that case so both take the same time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(auth): run the dummy bcrypt check for accounts without a usable hash

OIDC-provisioned and empty-hash accounts skipped bcrypt, so a failed
password sign-in for them answered faster than for an unknown username.
verify_password now falls back to the dummy hash whenever the stored one
is unusable, and the tests assert bcrypt ran on a valid hash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:00:36 -05:00
..