mirror of
https://github.com/friendica/friendica
synced 2025-04-26 02:30:11 +00:00
Issue 14303: Fixes %3f problem with OAuth login
This commit is contained in:
parent
26f8392754
commit
efee399397
3 changed files with 9 additions and 5 deletions
|
@ -68,19 +68,19 @@ class Authorize extends BaseApi
|
|||
|
||||
$redirect_request = $_REQUEST;
|
||||
unset($redirect_request['pagename']);
|
||||
$redirect = 'oauth/authorize?' . http_build_query($redirect_request);
|
||||
$redirect = http_build_query($redirect_request);
|
||||
|
||||
$uid = DI::userSession()->getLocalUserId();
|
||||
if (empty($uid)) {
|
||||
Logger::info('Redirect to login');
|
||||
DI::app()->redirect('login?return_path=' . urlencode($redirect));
|
||||
DI::app()->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_path' => $redirect, 'application' => $application['name']]));
|
||||
DI::app()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']]));
|
||||
}
|
||||
|
||||
DI::session()->remove('oauth_acknowledge');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue