login.html.twig 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Log in!{% endblock %}
  3. {% block body %}
  4. <form method="post">
  5. {% if error %}
  6. <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</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">Username</label>
  15. <input type="text" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="username" 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"
  19. value="{{ csrf_token('authenticate') }}"
  20. >
  21. {#
  22. Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
  23. See https://symfony.com/doc/current/security/remember_me.html
  24. <div class="checkbox mb-3">
  25. <input type="checkbox" name="_remember_me" id="_remember_me">
  26. <label for="_remember_me">Remember me</label>
  27. </div>
  28. #}
  29. <button class="btn btn-lg btn-blue" type="submit">
  30. Sign in
  31. </button>
  32. </form>
  33. {% endblock %}