/home/techb158/dev.balacoffee.com/vendor/laravel/passport/src/Bridge
Edit: /home/techb158/dev.balacoffee.com/vendor/laravel/passport/src/Bridge/UserRepository.php (2002B)
hasher = $hasher;
}
/**
* {@inheritdoc}
*/
public function getUserEntityByUserCredentials($username, $password, $grantType, ClientEntityInterface $clientEntity)
{
$provider = $clientEntity->provider ?: config('auth.guards.api.provider');
if (is_null($model = config('auth.providers.'.$provider.'.model'))) {
throw new RuntimeException('Unable to determine authentication model from configuration.');
}
if (method_exists($model, 'findAndValidateForPassport')) {
$user = (new $model)->findAndValidateForPassport($username, $password);
if (! $user) {
return;
}
return new User($user->getAuthIdentifier());
}
if (method_exists($model, 'findForPassport')) {
$user = (new $model)->findForPassport($username);
} else {
$user = (new $model)->where('email', $username)->first();
}
if (! $user) {
return;
} elseif (method_exists($user, 'validateForPassportPasswordGrant')) {
if (! $user->validateForPassportPasswordGrant($password)) {
return;
}
} elseif (! $this->hasher->check($password, $user->getAuthPassword())) {
return;
}
return new User($user->getAuthIdentifier());
}
}