login.html.twig
754 Bytes
{% extends 'base.html.twig' %}
{% block body %}
{% if error %}
<div>{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
<form action="{{ path('login') }}" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="_username" value="{{ last_username }}" />
<label for="password">Password:</label>
<input type="password" id="password" name="_password" />
<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"
>
{% if is_granted('ROLE_DOCENTE') %}
<input type="hidden" name="_target_path" value="{{ path('user_registration') }}" />
{% endif %}
<button type="submit">login</button>
</form>
{% endblock %}