httpContext = $httpContext; $this->_customerUrl = $customerUrl; $this->_postDataHelper = $postDataHelper; } /** * @return string */ public function getHref() { return $this->isLoggedIn() ? $this->_customerUrl->getLogoutUrl() : $this->_customerUrl->getLoginUrl(); } /** * @return string */ public function getLabel() { return $this->isLoggedIn() ? __('Sign Out') : __('Sign In'); } /** * Retrieve params for post request * * @return string */ public function getPostParams() { return $this->_postDataHelper->getPostData($this->getHref()); } /** * Is logged in * * @return bool */ public function isLoggedIn() { return $this->httpContext->getValue(Context::CONTEXT_AUTH); } /** * {@inheritdoc} * @since 101.0.0 */ public function getSortOrder() { return $this->getData(self::SORT_ORDER); } }