From 0ff6e0946047a5b6994f868957f5189015e4c3e6 Mon Sep 17 00:00:00 2001 From: Gurami Kutivadze Date: Tue, 4 Apr 2023 14:23:11 +0400 Subject: [PATCH] fix passport provider problem --- src/Lodash/Auth/Passport/Guards/TokenGuard.php | 3 +++ src/Lodash/Auth/Passport/PassportServiceProvider.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Lodash/Auth/Passport/Guards/TokenGuard.php b/src/Lodash/Auth/Passport/Guards/TokenGuard.php index 7a46950..2fa9602 100644 --- a/src/Lodash/Auth/Passport/Guards/TokenGuard.php +++ b/src/Lodash/Auth/Passport/Guards/TokenGuard.php @@ -5,6 +5,7 @@ namespace Longman\LaravelLodash\Auth\Passport\Guards; use Illuminate\Contracts\Encryption\Encrypter; +use Illuminate\Http\Request; use Laravel\Passport\Guards\TokenGuard as BaseTokenGuard; use Laravel\Passport\PassportUserProvider; use League\OAuth2\Server\ResourceServer; @@ -19,11 +20,13 @@ public function __construct( TokenRepositoryContract $tokens, ClientRepositoryContract $clients, Encrypter $encrypter, + Request $request, ) { $this->server = $server; $this->tokens = $tokens; $this->clients = $clients; $this->provider = $provider; $this->encrypter = $encrypter; + $this->request = $request; } } diff --git a/src/Lodash/Auth/Passport/PassportServiceProvider.php b/src/Lodash/Auth/Passport/PassportServiceProvider.php index 6af6cbd..e51d81f 100644 --- a/src/Lodash/Auth/Passport/PassportServiceProvider.php +++ b/src/Lodash/Auth/Passport/PassportServiceProvider.php @@ -75,7 +75,8 @@ protected function makeGuard(array $config): RequestGuard $this->app->make(TokenRepositoryContract::class), $this->app->make(ClientRepositoryContract::class), $this->app->make('encrypter'), - ))->user($request); + $request, + ))->user(); }, $this->app['request']); }