Update config, make oauth opt-in

pull/1136/head
Daniel Supernault 2019-04-17 19:45:23 -06:00
rodzic a665b90b60
commit bedb42baca
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
2 zmienionych plików z 17 dodań i 13 usunięć

Wyświetl plik

@ -25,19 +25,21 @@ class AuthServiceProvider extends ServiceProvider
{
$this->registerPolicies();
Passport::routes();
Passport::tokensExpireIn(now()->addDays(15));
Passport::refreshTokensExpireIn(now()->addDays(30));
Passport::enableImplicitGrant();
Passport::setDefaultScope([
'user:read',
'user:write'
]);
if(config('pixelfed.oauth_enabled')) {
Passport::routes();
Passport::tokensExpireIn(now()->addDays(15));
Passport::refreshTokensExpireIn(now()->addDays(30));
Passport::enableImplicitGrant();
Passport::setDefaultScope([
'user:read',
'user:write'
]);
Passport::tokensCan([
'user:read' => 'Read a users profile info and media',
'user:write' => 'This scope lets an app "Change your profile information"',
]);
Passport::tokensCan([
'user:read' => 'Read a users profile info and media',
'user:write' => 'This scope lets an app "Change your profile information"',
]);
}
}
}

Wyświetl plik

@ -276,4 +276,6 @@ return [
]
]
],
'oauth_enabled' => env('OAUTH_ENABLED', false),
];