Skip to content

Commit

Permalink
Fix 405 issue with user logout
Browse files Browse the repository at this point in the history
  • Loading branch information
huangsam committed Mar 2, 2024
1 parent 6b8de99 commit 41dd438
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion templates/core/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<a class="nav-link {% nav_active request 'portal:profile' %}" href="{% url 'portal:profile' %}">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link {% nav_active request 'logout' %}" href="{% url 'logout' %}">Logout</a>
<!-- Logout method must be POST, as GET was deprecated in Django 4.1 -->
<form id="logout-form" method="post" action="{% url 'admin:logout' %}">
{% csrf_token %}
<button class="nav-link" type="submit">Logout</button>
</form>
</li>
{% else %}
<li class="nav-item">
Expand Down

0 comments on commit 41dd438

Please sign in to comment.