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);
    }