]> git.mxchange.org Git - friendica.git/blobdiff - src/Security/FKOAuth1.php
Move basic auth functionality to the new class
[friendica.git] / src / Security / FKOAuth1.php
index df6b38a171b27baeee506997dc3f106618c2e18a..0cd10af7aec305800f25228b12e6bdf064435023 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -55,7 +55,7 @@ class FKOAuth1 extends OAuthServer
                $a = DI::app();
                $record = DBA::selectFirst('user', [], ['uid' => $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1]);
 
-               if (!DBA::isResult($record)) {
+               if (!DBA::isResult($record) || empty($uid)) {
                        Logger::info('FKOAuth1::loginUser failure', ['server' => $_SERVER]);
                        header('HTTP/1.0 401 Unauthorized');
                        die('This api requires login');