{% extends 'base/one.column.html.twig' %}

{% set title %}Login{% endset %}

{% block body %}
    <form action="{{ path('login') }}" method="post">
        {% if error %}
            <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
        {% endif %}
        {% if app.user %}
            <div class="mb-3">
                You are already logged in as {{ app.user }}, <a href="{{ path('logout') }}">Logout</a>
            </div>
        {% endif %}
        <label for="inputUsername">Username</label>
        <input type="text" value="{{ last_username }}" name="_username" id="inputUsername" class="form-control" required
               autofocus>
        <br/>
        <label for="inputPassword">Password</label>
        <input type="password" name="_password" id="inputPassword" class="form-control" required>
        <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
        <br/>

        <div class="checkbox mb-3">
            <label>
                <input type="checkbox" name="_remember_me"> Remember me
            </label>
        </div>
        <button class="btn btn-primary" type="submit">Login</button>
    </form>
{% endblock %}
