Как я могу программно войти в систему клиента в определенном магазине в Magento 2?
Я пытался переопределить метод execute
Magento\Customer\Controller\Account\LoginPost
и сделал что-то вроде этого:
$this->storeManager->setCurrentStore("store_code");
$store = $this->storeRepository->getActiveStoreByCode("store_code");
$this->httpContext->setValue("store", "store_code", "default");
$this->storeCookieManager->setStoreCookie($store);
$customer = $this->customerAccountManagement->authenticate($login['username'], $login['password']);
$this->session->setCustomerDataAsLoggedIn($customer);
Но это не сработало.