mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #7649 from kinglozzer/logout-backurl
FIX: Restore BackURL preservation on log out (closes #7636)
This commit is contained in:
commit
c23d1f3f99
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Security\MemberAuthenticator;
|
namespace SilverStripe\Security\MemberAuthenticator;
|
||||||
|
|
||||||
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
use SilverStripe\Control\HTTPResponse;
|
use SilverStripe\Control\HTTPResponse;
|
||||||
use SilverStripe\Control\RequestHandler;
|
use SilverStripe\Control\RequestHandler;
|
||||||
@ -109,6 +110,14 @@ class LogoutHandler extends RequestHandler
|
|||||||
return $this->redirect($backURL);
|
return $this->redirect($backURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirect(Security::config()->get('login_url'));
|
$link = Security::config()->get('login_url');
|
||||||
|
$referer = $this->getReturnReferer();
|
||||||
|
if ($referer) {
|
||||||
|
$link = Controller::join_links($link, '?' . http_build_query([
|
||||||
|
'BackURL' => Director::makeRelative($referer)
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->redirect($link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user