confirmAuthentication method

bool confirmAuthentication(
  1. UserAuthentication authentication,
  2. String basePassword
)

Returns true if basePassword is confirmed by authentication

Implementation

bool confirmAuthentication(
  UserAuthentication authentication,
  String basePassword,
) {
  final hashedPassword = passwordHasher.hash(
    password: basePassword,
    salt: authentication.salt,
    method: methodGenerator.decryptMethod(authentication.method),
  );

  return authentication.password == hashedPassword;
}