Skip to content

Commit

Permalink
Merge pull request #2214 from bookwyrm-social/logout-post
Browse files Browse the repository at this point in the history
Use POST instead of GET for logout function
  • Loading branch information
mouse-reeve committed Jul 10, 2022
2 parents a7cc41c + 64bfe59 commit bead43a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bookwyrm/settings.py
Expand Up @@ -11,7 +11,7 @@
env = Env()
env.read_env()
DOMAIN = env("DOMAIN")
VERSION = "0.4.2"
VERSION = "0.4.3"

RELEASE_API = env(
"RELEASE_API",
Expand Down
12 changes: 9 additions & 3 deletions bookwyrm/templates/user_menu.html
Expand Up @@ -68,9 +68,15 @@
<li class="navbar-divider" role="presentation" aria-hidden="true">&nbsp;</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>
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/views/landing/login.py
Expand Up @@ -77,7 +77,7 @@ def post(self, request):
class Logout(View):
"""log out"""

def get(self, request):
def post(self, request):
"""done with this place! outa here!"""
logout(request)
return redirect("/")

0 comments on commit bead43a

Please sign in to comment.