isUserPasswordCorrect method

Future<bool> isUserPasswordCorrect({
  1. required String userName,
  2. required String hashedPassword,
})

Verifies if the provided username and hashed password match a user in the database.

  • userName: The username of the user.
  • hashedPassword: The hashed password to verify.

Returns true if the credentials match, otherwise returns false.

Implementation

Future<bool> isUserPasswordCorrect({required String userName, required String hashedPassword}) async {
  User? user = await getUserByName(userName);
  return user != null && user.hashedPassword == hashedPassword;
}