Skip to content

Commit

Permalink
update to force POST request for logout (django 5) (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
dianekaplan authored Oct 22, 2024
1 parent ac626b1 commit 96ee513
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mysite/familytree/templates/familytree/top_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,19 @@
<div class="dropdown-menu">
<a class="dropdown-item" href="{% url 'account' %}">My Updates</a>
<a class="dropdown-item" href="{% url 'password_reset' %}">Reset Password</a>
<a class="dropdown-item" href="{% url 'logout' %}">Log out</a>

<form id="logout-form" action="{% url 'logout' %}" method="post">
<a class="dropdown-item" href="#" onclick="document.getElementById('logout-form').submit(); return false;">Log out</a>
{% csrf_token %}
</form>
</div>
</li>
{% else %}
<li class="nav-item">
<a class="dropdown-item" href="{% url 'logout' %}">Log out</a>
<form id="logout-form" action="{% url 'logout' %}" method="post">
<a class="dropdown-item" href="#" onclick="document.getElementById('logout-form').submit(); return false;">Log out</a>
{% csrf_token %}
</form>
</li>
{% endif %}

Expand Down

0 comments on commit 96ee513

Please sign in to comment.