Merge pull request #7256 from MrPetovan/bug/7249-remote-logout

Fix remote logout
This commit is contained in:
Philipp 2019-06-12 07:37:42 +02:00 committed by GitHub
commit 17490fca33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 34 additions and 14 deletions

View file

@ -9,6 +9,8 @@ use Friendica\BaseModule;
use Friendica\Core\Authentication;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Model\Profile;
/**
* Logout module
@ -22,9 +24,19 @@ class Logout extends BaseModule
*/
public static function init()
{
$visitor_home = null;
if (remote_user()) {
$visitor_home = Profile::getMyURL();
}
Hook::callAll("logging_out");
Authentication::deleteSession();
info(L10n::t('Logged out.') . EOL);
self::getApp()->internalRedirect();
if ($visitor_home) {
System::externalRedirect($visitor_home);
} else {
info(L10n::t('Logged out.'));
self::getApp()->internalRedirect();
}
}
}