1
1
Fork 0

Simplified code

This commit is contained in:
Michael 2021-06-08 08:04:12 +00:00
parent 8cde7fe51f
commit 85217941e3

View file

@ -191,12 +191,12 @@ class BaseApi extends BaseModule
*/
protected static function login(string $scope)
{
$token = OAuth::getCurrentApplicationToken();
if (!empty($token)) {
$uid = OAuth::getCurrentUserID();
if (!empty($uid)) {
if (!OAuth::isAllowedScope($scope)) {
DI::mstdnError()->Forbidden();
}
$uid = OAuth::getCurrentUserID();
}
if (empty($uid)) {