defaultValidatePasswordHash function

Future<PasswordValidationResult> defaultValidatePasswordHash({
  1. required String password,
  2. required String email,
  3. required String hash,
})

The default validation password hash.

Warning: Using a custom hashing algorithm for passwords will permanently disrupt compatibility with Serverpod's password hash validation and migration.

Implementation

Future<PasswordValidationResult> defaultValidatePasswordHash({
  required String password,
  required String email,
  required String hash,
}) async => await PasswordHash(
  hash,
  legacySalt: EmailSecrets.legacySalt,
  legacyEmail: AuthConfig.current.extraSaltyHash ? email : null,
  pepper: EmailSecrets.pepper,
).validate(password);