Skip to main content

verify_password

Return two booleans. The first is whether the raw password matches the three part encoded digest, and the second whether to regenerate the password.

def verify_password(
password: string,
encoded: string,
preferred: string = "default"
) - > tuple

Return two booleans. The first is whether the raw password matches the three part encoded digest, and the second whether to regenerate the password.

Parameters

NameTypeDescription
passwordstringThe raw, plain-text password string to be verified.
encodedstringThe hashed password string against which the raw password will be compared.
preferredstring = "default"The identifier of the hashing algorithm that should be used for new or updated passwords.

Returns

TypeDescription
tupleA tuple containing two booleans: (is_correct, must_update). The first indicates if the password matches the digest; the second indicates if the password should be re-hashed using the preferred hasher or updated settings.