Skip to content

verifyPassword

function verifyPassword(password, stored): Promise<boolean>;

Defined in: src/auth/basic.ts:76

Verify a candidate password against a digest produced by hashPassword.

Re-derives the scrypt hash using the stored salt and compares it to the stored hash with crypto.timingSafeEqual (constant time). Returns false — rather than throwing — for malformed or unrecognized digests.

Parameter Type
password string
stored string

Promise<boolean>