return redirectReponse insteadof sending it

This commit is contained in:
Manuel Raynaud
2014-04-28 20:45:58 +02:00
parent c4b2898830
commit 8aa5912a7a
3 changed files with 25 additions and 14 deletions

View File

@@ -23,6 +23,7 @@
namespace Front\Controller;
use Front\Front;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Thelia\Controller\Front\BaseFrontController;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerLoginEvent;
@@ -308,7 +309,9 @@ class CustomerController extends BaseFrontController
$this->processLogin($customer);
$this->redirectSuccess($customerLoginForm);
$successUrl = $customerLoginForm->getSuccessUrl();
return RedirectResponse::create($successUrl);
} catch (UsernameNotFoundException $e) {
$message = "Wrong email or password. Please try again";
@@ -346,7 +349,7 @@ class CustomerController extends BaseFrontController
}
// Redirect to home page
$this->redirect(URL::getInstance()->getIndexPage());
return RedirectResponse::create(URL::getInstance()->getIndexPage());
}
/**