Still can't find out why the flash isn't setting and rendering to the page.
This commit is contained in:
parent
f6fc19a55f
commit
5f2e7476ff
@ -27,13 +27,19 @@ class LoginUserAction extends Controller
|
||||
$user = $this->userRepository->getFromEmail($credentials['email']);
|
||||
} catch (EntityNotFoundException $e) {
|
||||
$this->logger->error("Unable to login user.");
|
||||
$this->session->getFlash()->add('error', "Unable to login user.");
|
||||
$this->session
|
||||
->getFlash()
|
||||
->add('error', "Unable to login user.");
|
||||
|
||||
return $this->render('user/login.twig')->withStatus(400);
|
||||
}
|
||||
|
||||
if (!$this->auth->verify($credentials['password'], $user->getPassword())) {
|
||||
$this->logger->error("Unable to verify user password.");
|
||||
$this->session->getFlash()->add('error', "Unable to login user.");
|
||||
$this->session
|
||||
->getFlash()
|
||||
->add('error', "Unable to login user.");
|
||||
|
||||
return $this->render('user/login.twig')->withStatus(400);
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,19 @@
|
||||
{% for message in flash.get('success') %}
|
||||
<div class="flash success">
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% for message in flash.get('notice') %}
|
||||
<div class="flash notice">
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if flash.has('error') %}
|
||||
<div>Hello!</div>
|
||||
{% endif %}
|
||||
|
||||
{% for message in flash.get('error') %}
|
||||
<div class="flash error">
|
||||
{{ message }}
|
||||
|
Loading…
Reference in New Issue
Block a user