mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update config, make oauth opt-in
This commit is contained in:
parent
a665b90b60
commit
bedb42baca
2 changed files with 17 additions and 13 deletions
|
@ -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 user’s profile info and media',
|
||||
'user:write' => 'This scope lets an app "Change your profile information"',
|
||||
]);
|
||||
Passport::tokensCan([
|
||||
'user:read' => 'Read a user’s profile info and media',
|
||||
'user:write' => 'This scope lets an app "Change your profile information"',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,4 +276,6 @@ return [
|
|||
]
|
||||
]
|
||||
],
|
||||
|
||||
'oauth_enabled' => env('OAUTH_ENABLED', false),
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue