mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Add config var to skip confirm logout (#7977)
This commit is contained in:
parent
e3b9fb3036
commit
47bcac930d
@ -37,6 +37,11 @@ class LogoutHandler extends RequestHandler
|
||||
'LogoutForm'
|
||||
];
|
||||
|
||||
/**
|
||||
* @config
|
||||
* @var bool
|
||||
*/
|
||||
private static $confirm_logout = true;
|
||||
|
||||
/**
|
||||
* Log out form handler method
|
||||
@ -54,7 +59,7 @@ class LogoutHandler extends RequestHandler
|
||||
|
||||
// If the user doesn't have a security token, show them a form where they can get one.
|
||||
// This protects against nuisance CSRF attacks to log out users.
|
||||
if ($member && !SecurityToken::inst()->checkRequest($this->getRequest())) {
|
||||
if ($member && self::config()->get('confirm_logout') && !SecurityToken::inst()->checkRequest($this->getRequest())) {
|
||||
Security::singleton()->setSessionMessage(
|
||||
_t(
|
||||
'SilverStripe\\Security\\Security.CONFIRMLOGOUT',
|
||||
|
Loading…
Reference in New Issue
Block a user