mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Updates for #3184
This commit is contained in:
@@ -22,8 +22,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Support\Authentication\RemoteUserGuard;
|
||||
use FireflyIII\Support\Authentication\RemoteUserProvider;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Laravel\Passport\Passport;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
@@ -48,11 +52,28 @@ class AuthServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Log::debug('Boot() of AuthServiceProvider');
|
||||
|
||||
Auth::provider(
|
||||
'remote_user_provider', function ($app, array $config) {
|
||||
//Log::debug('Creating remote_user_provider in Closure');
|
||||
return new RemoteUserProvider($app, $config);
|
||||
}
|
||||
);
|
||||
|
||||
Auth::extend(
|
||||
'remote_user_guard', static function ($app, string $name, array $config) {
|
||||
//Log::debug('Creating remote_user_guard in Closure');
|
||||
return new RemoteUserGuard(Auth::createUserProvider($config['provider']), $app);
|
||||
}
|
||||
);
|
||||
|
||||
$this->registerPolicies();
|
||||
|
||||
|
||||
Passport::routes();
|
||||
Passport::tokensExpireIn(now()->addDays(14));
|
||||
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user