templates/nav.html: logout view expects post requests

This commit is contained in:
Chris Tactic 2024-07-24 10:27:42 +02:00
parent 0a7a615288
commit a323901d0e

View File

@ -3,7 +3,7 @@
<div class="dropdown-trigger">
<button class="button square" aria-haspopup="true" aria-controls="dropdown-menu" type="button">
<span class="icon">
<i class="fa fa-user" aria-hidden="true"></i>
<i class="fa-regular fa-user" aria-hidden="true" style="opacity: 0.6"></i>
</span>
</button>
</div>
@ -40,11 +40,16 @@
{% translate "Statistics" %}
</a>
{% endblock %}
<hr class="dropdown-divider" />
{% endif %}
<a class="dropdown-item" href="{% url "logout" %}" data-force-reload="1">
{% translate "Disconnect" %}
</a>
{% if user.is_authenticated %}
<hr class="dropdown-divider" />
<form id="logout" action="{% url 'logout' %}" method="post">
{% csrf_token %}
<a class="dropdown-item" href="#" type="submit" onclick="document.getElementById('logout').submit();">
{% translate "Disconnect" %}
</a>
</form>
{% endif %}
</div>
</div>
</div>