Simplified code
This commit is contained in:
parent
8cde7fe51f
commit
85217941e3
|
@ -191,12 +191,12 @@ class BaseApi extends BaseModule
|
||||||
*/
|
*/
|
||||||
protected static function login(string $scope)
|
protected static function login(string $scope)
|
||||||
{
|
{
|
||||||
$token = OAuth::getCurrentApplicationToken();
|
$uid = OAuth::getCurrentUserID();
|
||||||
if (!empty($token)) {
|
|
||||||
|
if (!empty($uid)) {
|
||||||
if (!OAuth::isAllowedScope($scope)) {
|
if (!OAuth::isAllowedScope($scope)) {
|
||||||
DI::mstdnError()->Forbidden();
|
DI::mstdnError()->Forbidden();
|
||||||
}
|
}
|
||||||
$uid = OAuth::getCurrentUserID();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($uid)) {
|
if (empty($uid)) {
|
||||||
|
|
Loading…
Reference in a new issue