checkCredential method
Implementation
bool checkCredential(APICredential? credential) {
if (credential == null) return false;
if (username != credential.username) return false;
return !hasPassword || checkPassword(credential.password?.passwordHash);
}