/** * @throws \Magento\Framework\Exception\LocalizedException */ public function authenticate() { //authenticate ip address $authIp = $this->helper->authIpAddress(); if (!$authIp) { throw new \Magento\Framework\Exception\LocalizedException(__('You are not authorised to view content of this page.')); } //authenticate $auth = $this->helper->auth($this->getRequest()->getParam('code')); if (!$auth) { $this->sendResponse(); return; } }