Skip to content

Commit

Permalink
signing in after selecting checkout button, will not end up to checko…
Browse files Browse the repository at this point in the history
…ut page! magento#10834
  • Loading branch information
bohemiorulo committed Oct 27, 2017
1 parent 24c5815 commit 300697a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/code/Magento/Customer/Controller/Ajax/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ class Login extends \Magento\Framework\App\Action\Action
* @var ScopeConfigInterface
*/
protected $scopeConfig;

/**
* @var url
*/
protected $_url;

/**
* Initialize Login controller
Expand All @@ -82,6 +87,7 @@ public function __construct(
$this->customerAccountManagement = $customerAccountManagement;
$this->resultJsonFactory = $resultJsonFactory;
$this->resultRawFactory = $resultRawFactory;
$this->_url = $context->getUrl();
}

/**
Expand Down Expand Up @@ -172,6 +178,11 @@ public function execute()
if (!$this->getScopeConfig()->getValue('customer/startup/redirect_dashboard') && $redirectRoute) {
$response['redirectUrl'] = $this->_redirect->success($redirectRoute);
$this->getAccountRedirect()->clearRedirectCookie();
}else{
if(isset($credentials['context']) && $credentials['context'] == 'checkout'){
$response['redirectUrl'] = $this->_redirect->success($this->_url->getUrl('checkout', ['_secure' => true]));
$this->getAccountRedirect()->clearRedirectCookie();
}
}
} catch (EmailNotConfirmedException $e) {
$response = [
Expand Down

0 comments on commit 300697a

Please sign in to comment.