- @override
// //
Source
// AuthValidator overrides
/////
@override
Future<Authorization> fromBasicCredentials(
AuthBasicCredentials credentials) async {
var username = credentials.username;
var password = credentials.password;
var client = await clientForID(username);
if (client == null) {
return null;
}
if (client.hashedSecret == null) {
if (password == "") {
return new Authorization(client.id, null, this, credentials: credentials);
}
return null;
}
if (client.hashedSecret != hashPassword(password, client.salt)) {
return null;
}
return new Authorization(client.id, null, this, credentials: credentials);
}