checkPassword method
Implementation
Future<bool> checkPassword(String? username, String? password) async {
if (isEmptyString(username) || isEmptyString(password)) return false;
var now = DateTime.now().millisecondsSinceEpoch;
_cleanAuthentications(now);
var count = _authenticationCount.putIfAbsent(username!, () => 0);
if (count > 10) return false;
_authenticationCount[username] = count + 1;
_authenticationTime[username] = now;
var ok = await _authenticationGrantor(username, password!);
return ok;
}