mirror of
https://github.com/friendica/friendica
synced 2025-01-18 14:24:28 +00:00
Replace calls for App::redirect() with AppHelper
This commit is contained in:
parent
2c0db2f043
commit
d87f24f17a
3 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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'];
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue