src/Security/MemberAuthenticator/LogoutHandler.php
public function logout()
    {
        $member = Security::getCurrentUser();

        // 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())) {
            Security::singleton()->setSessionMessage(
                _t(
                    'SilverStripe\\Security\\Security.CONFIRMLOGOUT',
                    "Please click the button below to confirm that you wish to log out."
                ),
                ValidationResult::TYPE_WARNING
            );

            return [
                'Form' => $this->logoutForm()
            ];
        }

        return $this->doLogOut($member);
    }
public function logout()
    {
        $member = Security::getCurrentUser();

        // 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())) {
            Security::singleton()->setSessionMessage(
                _t(
                    'SilverStripe\\Security\\Security.CONFIRMLOGOUT',
                    "Please click the button below to confirm that you wish to log out."
                ),
                ValidationResult::TYPE_WARNING
            );

            return [
                'Form' => $this->logoutForm()
            ];
        }

        return $this->doLogOut($member);
    }
public function logout ( ) { $ member = Security :: getCurrentUser ( ) ; // 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 ( ) ) ) { Security :: singleton ( ) -> setSessionMessage ( _t ( 'SilverStripe\\Security\\Security.CONFIRMLOGOUT' , "Please click the button below to confirm that you wish to log out." ) , ValidationResult :: TYPE_WARNING ) ; return [ 'Form' => $ this -> logoutForm ( ) ] ; } return $ this -> doLogOut ( $ member ) ; }
Log out form handler method

This method is called when the user clicks on "logout" on the form
created when the parameter <i>$checkCurrentUser</i> of the
{@link __construct constructor} was set to TRUE and the user was
currently logged in.

@return array|HTTPResponse
Log out form handler method