login.html.twig 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Log in!{% endblock %}
  3. {% block content %}
  4. <form method="post">
  5. {% if error %}
  6. <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}<br/>{{ error.message }}</div>
  7. {% endif %}
  8. {% if app.user %}
  9. <div class="mb-3">
  10. You are logged in as {{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
  11. </div>
  12. {% endif %}
  13. <h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
  14. <label for="username">Email</label>
  15. <input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="email" required autofocus>
  16. <label for="password">Password</label>
  17. <input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
  18. <input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">
  19. {#
  20. Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
  21. See https://symfony.com/doc/current/security/remember_me.html
  22. #}
  23. <div class="checkbox mb-3">
  24. <input type="checkbox" name="_remember_me" id="_remember_me">
  25. <label for="_remember_me">Remember me</label>
  26. </div>
  27. <div>
  28. <a href="{{ path('app_forgot_password_request') }}">Forgot password?</a>
  29. </div>
  30. {# #}
  31. <button class="btn btn-lg btn-primary" type="submit">
  32. Sign in
  33. </button>
  34. </form>
  35. {% endblock %}