Skip to main content

verify_password

Verifies a plain text password against a hashed version and returns a tuple containing the verification result and an updated hash if a re-hash is required.

def verify_password(
plain_password: str,
hashed_password: str
) - > tuple[bool, str | None]

Verifies a plain-text password against a hashed version and determines if the hash requires an update to meet current security standards.

Parameters

NameTypeDescription
plain_passwordstrThe raw, unencrypted password string provided by the user for authentication.
hashed_passwordstrThe existing hashed password string retrieved from the database to compare against.

Returns

TypeDescription
`tuple[bool, strNone]`