]> git.mxchange.org Git - friendica.git/commitdiff
Simplified code
authorMichael <heluecht@pirati.ca>
Tue, 8 Jun 2021 08:04:12 +0000 (08:04 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 8 Jun 2021 08:04:12 +0000 (08:04 +0000)
src/Module/BaseApi.php

index 855f6ac23f203d79a90cd449618504f1b5041f93..5e5b3986b14ffe92b1fc8fd0e741b1e5ef722291 100644 (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)) {