So I\'m reading the security chapter of Symfony2 Book. I understand everything, but I\'d like to customize the error message if a there is a login error.
In which fi
There is another possibility if you don't want to use translations. You can just replace the message, for example:
{{ error.message | replace({"Bad credentials." : "Invalid username or password."}) }}
You can use translation. In parameters.ini set locale to your language and create message file. Then in twig template use:
{% if error %}
<div class="error">{{ error.message|trans({},'messages') }}</div>
{% endif %}