]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/OAuth/Authorize.php
API: Show different ids on reshares / don't check for client secret
[friendica.git] / src / Module / OAuth / Authorize.php
index 973f31a0b185d9c0a822fecc573f91b12631898a..efa0666940e77aa3adba5779b849ef67eee68998 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -39,7 +39,7 @@ class Authorize extends BaseApi
         */
        protected function rawContent(array $request = [])
        {
-               $request = self::getRequest([
+               $request = $this->getRequest([
                        'force_login'   => '', // Forces the user to re-login, which is necessary for authorizing with multiple accounts from the same instance.
                        'response_type' => '', // Should be set equal to "code".
                        'client_id'     => '', // Client ID, obtained during app registration.
@@ -70,7 +70,7 @@ class Authorize extends BaseApi
                unset($redirect_request['pagename']);
                $redirect = 'oauth/authorize?' . http_build_query($redirect_request);
 
-               $uid = local_user();
+               $uid = DI::userSession()->getLocalUserId();
                if (empty($uid)) {
                        Logger::info('Redirect to login');
                        DI::app()->redirect('login?return_path=' . urlencode($redirect));