diff --git a/config/packages/security.yaml b/config/packages/security.yaml index bb1363d..0b0d691 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -18,6 +18,9 @@ security: # https://symfony.com/doc/current/security/impersonating_user.html # switch_user: true + form_login: + login_path: users_login + check_path: users_login # Easy way to control access for large sections of your site # Note: Only the *first* access control that matches will be used diff --git a/templates/login.html.twig b/templates/login.html.twig index bc2dac7..41ff2da 100644 --- a/templates/login.html.twig +++ b/templates/login.html.twig @@ -8,25 +8,25 @@ {{ parent() }}
-
- - - - + {% block body %} + {% if error %} +
{{ error.messageKey|trans(error.messageData, 'security') }}
+ {% endif %} - + + + - + + - -
+ {# If you want to control the URL the user is redirected to on success + #} - {% if error %} - - {% endif %} + + + {% endblock %}
{% endblock %} diff --git a/templates/register.html.twig b/templates/register.html.twig index 291dc89..3ec74fc 100644 --- a/templates/register.html.twig +++ b/templates/register.html.twig @@ -8,7 +8,7 @@ {{ parent() }}
- {{ form_start(form, {'action': path('users_create'), 'method': 'POST'}) }} + {{ form_start(form) }} {{ form_widget(form) }}