mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-09-20 00:08:01 +00:00
Update config() to config_cache()
This commit is contained in:
parent
53134208fe
commit
3e52458889
6 changed files with 9 additions and 9 deletions
|
@ -66,7 +66,7 @@ class ApiV1Controller extends Controller
|
||||||
|
|
||||||
public function apps(Request $request)
|
public function apps(Request $request)
|
||||||
{
|
{
|
||||||
abort_if(!config('pixelfed.oauth_enabled'), 404);
|
abort_if(!config_cache('pixelfed.oauth_enabled'), 404);
|
||||||
|
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'client_name' => 'required',
|
'client_name' => 'required',
|
||||||
|
@ -984,7 +984,7 @@ class ApiV1Controller extends Controller
|
||||||
'max_caption_length' => (int) config('pixelfed.max_caption_length'),
|
'max_caption_length' => (int) config('pixelfed.max_caption_length'),
|
||||||
'max_bio_length' => (int) config('pixelfed.max_bio_length'),
|
'max_bio_length' => (int) config('pixelfed.max_bio_length'),
|
||||||
'max_album_length' => (int) config_cache('pixelfed.max_album_length'),
|
'max_album_length' => (int) config_cache('pixelfed.max_album_length'),
|
||||||
'mobile_apis' => config('pixelfed.oauth_enabled')
|
'mobile_apis' => config_cache('pixelfed.oauth_enabled')
|
||||||
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
|
@ -26,7 +26,7 @@ class AuthServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
$this->registerPolicies();
|
$this->registerPolicies();
|
||||||
|
|
||||||
if(config('pixelfed.oauth_enabled')) {
|
if(config_cache('pixelfed.oauth_enabled')) {
|
||||||
Passport::routes(null, ['middleware' => ['twofactor', \Fruitcake\Cors\HandleCors::class]]);
|
Passport::routes(null, ['middleware' => ['twofactor', \Fruitcake\Cors\HandleCors::class]]);
|
||||||
Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 15)));
|
Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 15)));
|
||||||
Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30)));
|
Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30)));
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Config {
|
||||||
],
|
],
|
||||||
|
|
||||||
'features' => [
|
'features' => [
|
||||||
'mobile_apis' => config('pixelfed.oauth_enabled'),
|
'mobile_apis' => config_cache('pixelfed.oauth_enabled'),
|
||||||
'circles' => false,
|
'circles' => false,
|
||||||
'stories' => config('instance.stories.enabled'),
|
'stories' => config('instance.stories.enabled'),
|
||||||
'video' => Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'),
|
'video' => Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'),
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<h3 class="font-weight-bold">Applications</h3>
|
<h3 class="font-weight-bold">Applications</h3>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
@if(config('pixelfed.oauth_enabled') == true)
|
@if(config_cache('pixelfed.oauth_enabled') == true)
|
||||||
<passport-authorized-clients></passport-authorized-clients>
|
<passport-authorized-clients></passport-authorized-clients>
|
||||||
<passport-personal-access-tokens></passport-personal-access-tokens>
|
<passport-personal-access-tokens></passport-personal-access-tokens>
|
||||||
@else
|
@else
|
||||||
|
@ -16,4 +16,4 @@
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="text/javascript" src="{{mix('js/developers.js')}}"></script>
|
<script type="text/javascript" src="{{mix('js/developers.js')}}"></script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<h3 class="font-weight-bold">Developers</h3>
|
<h3 class="font-weight-bold">Developers</h3>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
@if(config('pixelfed.oauth_enabled') == true)
|
@if(config_cache('pixelfed.oauth_enabled') == true)
|
||||||
<passport-clients></passport-clients>
|
<passport-clients></passport-clients>
|
||||||
@else
|
@else
|
||||||
<p class="lead">OAuth has not been enabled on this instance.</p>
|
<p class="lead">OAuth has not been enabled on this instance.</p>
|
||||||
|
@ -16,4 +16,4 @@
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="text/javascript" src="{{mix('js/developers.js')}}"></script>
|
<script type="text/javascript" src="{{mix('js/developers.js')}}"></script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<a class="nav-link font-weight-light text-muted" href="{{route('settings.dataexport')}}">Data Export</a>
|
<a class="nav-link font-weight-light text-muted" href="{{route('settings.dataexport')}}">Data Export</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@if(config('pixelfed.oauth_enabled') == true)
|
@if(config_cache('pixelfed.oauth_enabled') == true)
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<hr>
|
<hr>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in a new issue