login method
Logs in the user by checking their credentials (username and hashed password).
userName: The username of the user attempting to log in.hashedPassword: The hashed password for the user.
Returns the User if credentials are correct, otherwise returns null.
Implementation
Future<User?> login({required String userName, required String hashedPassword}) async {
if (await isUserPasswordCorrect(userName: userName, hashedPassword: hashedPassword)) {
return await getUserByName(userName);
} else {
return null;
}
}