X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/vendor/laravel/passport/src/Bridge
home
/
gfecatvj
/
sites
/
realesbar
/
vendor
/
laravel
/
passport
/
src
/
Bridge
/
📁
..
📄
AccessToken.php
(958 B)
📄
AccessTokenRepository.php
(2.55 KB)
📄
AuthCode.php
(380 B)
📄
AuthCodeRepository.php
(1.36 KB)
📄
Client.php
(1.38 KB)
📄
ClientRepository.php
(2.95 KB)
📄
FormatsScopesForStorage.php
(625 B)
📄
PersonalAccessGrant.php
(1.23 KB)
📄
RefreshToken.php
(323 B)
📄
RefreshTokenRepository.php
(2.14 KB)
📄
Scope.php
(607 B)
📄
ScopeRepository.php
(1.05 KB)
📄
User.php
(438 B)
📄
UserRepository.php
(1.96 KB)
Editing: UserRepository.php
<?php namespace Laravel\Passport\Bridge; use Illuminate\Contracts\Hashing\Hasher; use League\OAuth2\Server\Entities\ClientEntityInterface; use League\OAuth2\Server\Repositories\UserRepositoryInterface; use RuntimeException; class UserRepository implements UserRepositoryInterface { /** * The hasher implementation. * * @var \Illuminate\Contracts\Hashing\Hasher */ protected $hasher; /** * Create a new repository instance. * * @param \Illuminate\Contracts\Hashing\Hasher $hasher * @return void */ public function __construct(Hasher $hasher) { $this->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()); } }
Upload File
Create Folder