Structsยง
Enumsยง
- Password
Verify ๐Result - Outcome of verifying a password against a stored Argon2 hash.
Staticsยง
- LEGACY_
RAW_ ๐PASSWORD_ FALLBACK_ UNTIL - Passwords whose hash was stored under the pre-normalization (raw byte) form are accepted until this instant; afterwards only the NFC form is checked and any not-yet-converted user must reset their password. Set to one year after the normalization rollout โ ADJUST to one year after the actual deploy date.
Functionsยง
- change_
user_ password_ with_ old_ password - change_
user_ password_ with_ password_ reset_ token - check_
if_ users_ password_ is_ stored - get_
unused_ reset_ password_ token_ with_ user_ id - hash_
password - insert_
password_ reset_ token - is_
reset_ password_ token_ valid - legacy_
raw_ ๐fallback_ active - Whether the legacy raw-byte password form is still accepted at
now. - mark_
token_ used - normalize_
password ๐ - Normalize a password to Unicode NFC before it is hashed or verified.
- update_
password_ ๐hash_ if_ unchanged - Re-stores
new_hashfor the user only if the currently stored hash still equalsexpected_current_hash(a compare-and-swap). Returnstrueif the row was updated andfalseif the stored hash had already changed (e.g. a concurrent password change) or no active row matched, in which case nothing is written. Used by the legacy-rehash path so that a concurrent password change is never clobbered by re-storing a hash derived from the old password. - upsert_
user_ password - verify_
against_ ๐hash - Verify a password against a stored Argon2 hash, tolerant of Unicode normalization.
- verify_
user_ password