]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/OAuth/Authorize.php
Remove DI dependency from Module\Contact\Profile
[friendica.git] / src / Module / OAuth / Authorize.php
index 6a574a2ac5a7dfafb7feaab6ff366b15fd156f10..ea91de5a045d70f8fd8b4d9be74bb51edde0715b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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));
@@ -91,7 +91,7 @@ class Authorize extends BaseApi
                }
 
                if ($application['redirect_uri'] != 'urn:ietf:wg:oauth:2.0:oob') {
-                       DI::app()->redirect($application['redirect_uri'] . (strpos($application['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']]));
+                       DI::app()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']]));
                }
 
                self::$oauth_code = $token['code'];