mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update AuthServiceProvider, increase default token + refresh token lifetime
This commit is contained in:
parent
0788bffa37
commit
178ed63d0a
1 changed files with 6 additions and 6 deletions
|
@ -26,10 +26,10 @@ class AuthServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
$this->registerPolicies();
|
$this->registerPolicies();
|
||||||
|
|
||||||
if(config('pixelfed.oauth_enabled')) {
|
if(config_cache('pixelfed.oauth_enabled') == true) {
|
||||||
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', 356)));
|
||||||
Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30)));
|
Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 400)));
|
||||||
Passport::enableImplicitGrant();
|
Passport::enableImplicitGrant();
|
||||||
if(config('instance.oauth.pat.enabled')) {
|
if(config('instance.oauth.pat.enabled')) {
|
||||||
Passport::personalAccessClientId(config('instance.oauth.pat.id'));
|
Passport::personalAccessClientId(config('instance.oauth.pat.id'));
|
||||||
|
@ -48,8 +48,8 @@ class AuthServiceProvider extends ServiceProvider
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Gate::define('viewWebSocketsDashboard', function ($user = null) {
|
// Gate::define('viewWebSocketsDashboard', function ($user = null) {
|
||||||
return $user->is_admin;
|
// return $user->is_admin;
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue