rssManager = $rssManager; $this->scopeConfig = $scopeConfig; $this->rssFactory = $rssFactory; $this->customerSession = $customerSession; $this->customerAccountManagement = $customerAccountManagement; $this->httpAuthentication = $httpAuthentication; $this->logger = $logger; parent::__construct($context); } /** * @return bool */ protected function auth() { if (!$this->customerSession->isLoggedIn()) { list($login, $password) = $this->httpAuthentication->getCredentials(); try { $customer = $this->customerAccountManagement->authenticate($login, $password); $this->customerSession->setCustomerDataAsLoggedIn($customer); $this->customerSession->regenerateId(); } catch (\Exception $e) { $this->logger->critical($e); } } if (!$this->customerSession->isLoggedIn()) { $this->httpAuthentication->setAuthenticationFailed('RSS Feeds'); return false; } return true; } }