fix: rename login field from 'email' to '_username'

Symfony FormLoginAuthenticator expects _username by default.
The field used name="email" which caused 400 Bad Request on submit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Simon Kuehn 2026-05-17 18:42:32 +00:00
parent 0706fdad58
commit edc0cdfd5d

View file

@ -0,0 +1,24 @@
{% extends 'base.html.twig' %}
{% block title %}Login{% endblock %}
{% block body %}
<div style="max-width:400px;margin:4rem auto;font-family:sans-serif">
<h1>SuperSeller Login</h1>
{% if error %}
<div style="color:red;margin-bottom:1rem">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
<form method="post">
<div style="margin-bottom:1rem">
<label for="email">Email</label><br>
<input id="email" type="email" name="_username" value="{{ last_username }}" required autofocus style="width:100%;padding:.5rem">
</div>
<div style="margin-bottom:1rem">
<label for="password">Password</label><br>
<input id="password" type="password" name="password" required style="width:100%;padding:.5rem">
</div>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<button type="submit" style="padding:.5rem 1rem">Login</button>
</form>
</div>
{% endblock %}