Authentication: comparison of v.3 vs v.4
Versions Compared
Old Version 3
changes.mady.by.user Dominika Kurek
Saved on Feb 02, 2016
compared with
New Version Current
changes.mady.by.user Bertrand Dunogier
Saved on Feb 02, 2016
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment: Added the "authenticate" parameter to csrf_token
...
| Code Block | ||
|---|---|---|
|
||
{% extends layout %}
{% block content %}
{% block login_content %}
{% if error %}
<div>{{ error.message|trans }}</div>
{% endif %}
<form action="{{ path( 'login_check' ) }}" method="post">
{% block login_fields %}
<label for="username">{{ 'Username:'|trans }}</label>
<input type="text" id="username" name="_username" value="{{ last_username }}" />
<label for="password">{{ 'Password:'|trans }}</label>
<input type="password" id="password" name="_password" />
<input type="hidden" name="_csrf_token" value="{{ csrf_token("authenticate") }}" />
{#
If you want to control the URL the user
is redirected to on success (more details below)
<input type="hidden" name="_target_path" value="/account" />
#}
<button type="submit">{{ 'Login'|trans }}</button>
{% endblock %}
</form>
{% endblock %}
{% endblock %}
|
...
Comments
Add a comment