{% extends "_base.html" %}
{% block content %}
<h1>Authorize Client</h1>
<p>Client ID: <code>{{ client_id }}</code></p>

<form method="post">
  {% if sub_missing %}
  <input
    type="text"
    name="sub"
    placeholder="sub"
    required
    autofocus
    aria-invalid="true"
    aria-describedby="sub-missing"
  />
  <small id="sub-missing">The field is missing</small>
  {% else %}
  <input type="text" name="sub" placeholder="sub" required autofocus />
  {% endif %}
  <button type="submit">Authorize</button>
</form>
<form method="post">
  <button type="submit" name="action" value="deny">Deny</button>
</form>
<p>You will be redirected to {{ redirect_uri }}</p>

{% if recent_subjects %}
<h2 id="heading-auth-previous">Authenticate previous users</h2>
<form method="post" aria-labelledby="heading-auth-previous">
{% for subject in recent_subjects %}
  <button class="outline secondary" style="width: auto" type="submit" name="sub" value="{{ subject }}">{{ subject }}</button>
{% endfor %}
</form>
{% endif %}

{% endblock %}
