mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +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();
|
||||
|
||||
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;
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue