Skip to content

Commit

Permalink
Use Facade::resolved() before extending passport guard.
Browse files Browse the repository at this point in the history
This allows alternative implementation of `auth` to be able to use with passport without hacking around PackageManifest.

Based on PR made to laravel/framework#26824

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Apr 17, 2019
1 parent 708797d commit 7d1f52b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/PassportServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,11 @@ protected function makeCryptKey($type)
*/
protected function registerGuard()
{
Auth::extend('passport', function ($app, $name, array $config) {
return tap($this->makeGuard($config), function ($guard) {
$this->app->refresh('request', $guard, 'setRequest');
Auth::resolved(function ($auth) {
$auth->extend('passport', function ($app, $name, array $config) {
return tap($this->makeGuard($config), function ($guard) {
$this->app->refresh('request', $guard, 'setRequest');
});
});
});
}
Expand Down

0 comments on commit 7d1f52b

Please sign in to comment.