mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 17:41:08 +00:00
Use POST instead of GET for logout function
This commit is contained in:
parent
a7cc41ce54
commit
7a772c7d3e
2 changed files with 10 additions and 4 deletions
|
@ -68,9 +68,15 @@
|
|||
<li class="navbar-divider" role="presentation" aria-hidden="true"> </li>
|
||||
|
||||
<li role="menuitem">
|
||||
<a href="{% url 'logout' %}" class="navbar-item">
|
||||
{% trans 'Log out' %}
|
||||
</a>
|
||||
<form
|
||||
name="logout"
|
||||
method="POST"
|
||||
action="{% url 'logout' %}"
|
||||
class="navbar-item"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button type="submit">{% trans 'Log out' %}</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -77,7 +77,7 @@ class Login(View):
|
|||
class Logout(View):
|
||||
"""log out"""
|
||||
|
||||
def get(self, request):
|
||||
def post(self, request):
|
||||
"""done with this place! outa here!"""
|
||||
logout(request)
|
||||
return redirect("/")
|
||||
|
|
Loading…
Reference in a new issue