diff --git a/src/Module/OAuth/Acknowledge.php b/src/Module/OAuth/Acknowledge.php index 44c1b1a0fc..82ad166bc9 100644 --- a/src/Module/OAuth/Acknowledge.php +++ b/src/Module/OAuth/Acknowledge.php @@ -26,7 +26,7 @@ class Acknowledge extends BaseApi protected function post(array $request = []) { DI::session()->set('oauth_acknowledge', true); - DI::app()->redirect(DI::session()->get('return_path')); + DI::apphelper()->redirect(DI::session()->get('return_path')); } protected function content(array $request = []): string diff --git a/src/Module/OAuth/Authorize.php b/src/Module/OAuth/Authorize.php index 266f00402e..d4f3483c66 100644 --- a/src/Module/OAuth/Authorize.php +++ b/src/Module/OAuth/Authorize.php @@ -59,14 +59,14 @@ class Authorize extends BaseApi $uid = DI::userSession()->getLocalUserId(); if (empty($uid)) { Logger::info('Redirect to login'); - DI::app()->redirect('login?' . http_build_query(['return_authorize' => $redirect])); + DI::apphelper()->redirect('login?' . http_build_query(['return_authorize' => $redirect])); } else { Logger::info('Already logged in user', ['uid' => $uid]); } if (!OAuth::existsTokenForUser($application, $uid) && !DI::session()->get('oauth_acknowledge')) { Logger::info('Redirect to acknowledge'); - DI::app()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']])); + DI::apphelper()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']])); } DI::session()->remove('oauth_acknowledge'); @@ -77,7 +77,7 @@ class Authorize extends BaseApi } if ($application['redirect_uri'] != 'urn:ietf:wg:oauth:2.0:oob') { - DI::app()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']])); + DI::apphelper()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']])); } self::$oauth_code = $token['code']; diff --git a/src/Module/RandomProfile.php b/src/Module/RandomProfile.php index 4393bb579b..d590af634f 100644 --- a/src/Module/RandomProfile.php +++ b/src/Module/RandomProfile.php @@ -18,13 +18,13 @@ class RandomProfile extends BaseModule { protected function content(array $request = []): string { - $a = DI::app(); + $appHelper = DI::apphelper(); $contact = Contact::getRandomContact(); if (!empty($contact)) { $link = Contact::magicLinkByContact($contact); - $a->redirect($link); + $appHelper->redirect($link); } DI::baseUrl()->redirect('profile');