fix logout django 5 needing post request

This commit is contained in:
Simon 2024-05-20 13:17:11 +02:00
parent 478d05997c
commit d6f679784e
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 4 additions and 1 deletions

View File

@ -60,7 +60,10 @@
<a href="{% url 'settings' %}">
<img src="{% static 'img/icon-gear.svg' %}" alt="gear-icon" title="Settings">
</a>
<a href="{% url 'logout' %}">
<form id="logout-form" action="{% url 'logout' %}" method="post" style="display:none;">
{% csrf_token %}
</form>
<a href="#" onclick="document.getElementById('logout-form').submit();">
<img class="alert-hover" src="{% static 'img/icon-exit.svg' %}" alt="exit-icon" title="Logout">
</a>
</div>