From 178ed63d0afa8959497559390ee1cb3defaab5cd Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 May 2021 23:04:24 -0600 Subject: [PATCH] Update AuthServiceProvider, increase default token + refresh token lifetime --- app/Providers/AuthServiceProvider.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index a3230fa0a..1184e6a11 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -26,10 +26,10 @@ class AuthServiceProvider extends ServiceProvider { $this->registerPolicies(); - if(config('pixelfed.oauth_enabled')) { + if(config_cache('pixelfed.oauth_enabled') == true) { Passport::routes(null, ['middleware' => ['twofactor', \Fruitcake\Cors\HandleCors::class]]); - Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 15))); - Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30))); + Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 356))); + Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 400))); Passport::enableImplicitGrant(); if(config('instance.oauth.pat.enabled')) { Passport::personalAccessClientId(config('instance.oauth.pat.id')); @@ -48,8 +48,8 @@ class AuthServiceProvider extends ServiceProvider ]); } - Gate::define('viewWebSocketsDashboard', function ($user = null) { - return $user->is_admin; - }); + // Gate::define('viewWebSocketsDashboard', function ($user = null) { + // return $user->is_admin; + // }); } }