diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 02d8d5b83..bf47b8583 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -66,7 +66,7 @@ class ApiV1Controller extends Controller public function apps(Request $request) { - abort_if(!config('pixelfed.oauth_enabled'), 404); + abort_if(!config_cache('pixelfed.oauth_enabled'), 404); $this->validate($request, [ 'client_name' => 'required', @@ -984,7 +984,7 @@ class ApiV1Controller extends Controller 'max_caption_length' => (int) config('pixelfed.max_caption_length'), 'max_bio_length' => (int) config('pixelfed.max_bio_length'), 'max_album_length' => (int) config_cache('pixelfed.max_album_length'), - 'mobile_apis' => config('pixelfed.oauth_enabled') + 'mobile_apis' => config_cache('pixelfed.oauth_enabled') ] ]; diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index a3230fa0a..81430ef88 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -26,7 +26,7 @@ class AuthServiceProvider extends ServiceProvider { $this->registerPolicies(); - if(config('pixelfed.oauth_enabled')) { + if(config_cache('pixelfed.oauth_enabled')) { 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))); diff --git a/app/Util/Site/Config.php b/app/Util/Site/Config.php index 39f9d054c..75a60e9cb 100644 --- a/app/Util/Site/Config.php +++ b/app/Util/Site/Config.php @@ -54,7 +54,7 @@ class Config { ], 'features' => [ - 'mobile_apis' => config('pixelfed.oauth_enabled'), + 'mobile_apis' => config_cache('pixelfed.oauth_enabled'), 'circles' => false, 'stories' => config('instance.stories.enabled'), 'video' => Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'), diff --git a/resources/views/settings/applications.blade.php b/resources/views/settings/applications.blade.php index 912b108b6..691ab0c81 100644 --- a/resources/views/settings/applications.blade.php +++ b/resources/views/settings/applications.blade.php @@ -6,7 +6,7 @@

Applications


-@if(config('pixelfed.oauth_enabled') == true) +@if(config_cache('pixelfed.oauth_enabled') == true) @else @@ -16,4 +16,4 @@ @push('scripts') -@endpush \ No newline at end of file +@endpush diff --git a/resources/views/settings/developers.blade.php b/resources/views/settings/developers.blade.php index ade660d77..8b4c94471 100644 --- a/resources/views/settings/developers.blade.php +++ b/resources/views/settings/developers.blade.php @@ -6,7 +6,7 @@

Developers


-@if(config('pixelfed.oauth_enabled') == true) +@if(config_cache('pixelfed.oauth_enabled') == true) @else

OAuth has not been enabled on this instance.

@@ -16,4 +16,4 @@ @push('scripts') -@endpush \ No newline at end of file +@endpush diff --git a/resources/views/settings/partial/sidebar.blade.php b/resources/views/settings/partial/sidebar.blade.php index 478bc3a8b..8d6fd4011 100644 --- a/resources/views/settings/partial/sidebar.blade.php +++ b/resources/views/settings/partial/sidebar.blade.php @@ -41,7 +41,7 @@ Data Export - @if(config('pixelfed.oauth_enabled') == true) + @if(config_cache('pixelfed.oauth_enabled') == true)