From 2fa9645dfc4dc640d7460f069fc9536cce1e4fd2 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 11 Apr 2018 17:40:04 -0700 Subject: channel delegation: push current identity and pop it on logout from the delegated channel. This fixes the known issue of being forced to log back in after leaving the delegated channel. --- include/auth.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include/auth.php') diff --git a/include/auth.php b/include/auth.php index 844566919..c44eeb8fc 100644 --- a/include/auth.php +++ b/include/auth.php @@ -145,8 +145,17 @@ if((isset($_SESSION)) && (x($_SESSION, 'authenticated')) && // process logout request $args = array('channel_id' => local_channel()); call_hooks('logging_out', $args); - App::$session->nuke(); - info( t('Logged out.') . EOL); + + + if($_SESSION['delegate'] && $_SESSION['delegate_push']) { + $_SESSION = $_SESSION['delegate_push']; + info( t('Delegation session ended.') . EOL); + } + else { + App::$session->nuke(); + info( t('Logged out.') . EOL); + } + goaway(z_root()); } -- cgit v1.2.3