From 7cfae612db780b09d3fb3f7c5f386554970d1bb1 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 21 Nov 2020 20:24:36 -0700 Subject: [PATCH] Updated AuthServiceProvider, added support for configurable OAuth tokens and refresh tokens lifetime --- app/Providers/AuthServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 5c7fb7ff6..a3230fa0a 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -28,8 +28,8 @@ class AuthServiceProvider extends ServiceProvider if(config('pixelfed.oauth_enabled')) { Passport::routes(null, ['middleware' => ['twofactor', \Fruitcake\Cors\HandleCors::class]]); - Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration'))); - Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration'))); + Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 15))); + Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30))); Passport::enableImplicitGrant(); if(config('instance.oauth.pat.enabled')) { Passport::personalAccessClientId(config('instance.oauth.pat.id'));