Function verifyPasswordHash

  • Verifies a password hash against a password attempt.

    Parameters

    • passwordHash: PasswordHashType

      The password hash to verify against.

    • passwordAttempt: string

      The password attempt to verify.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the password attempt matches the password hash.

    Example

    const passwordHash = await generatePasswordHash('password'); // default options used
    const isPasswordValid = await verifyPasswordHash(passwordHash, 'password'); // default options used