Skip to content

Commit

Permalink
fix logout redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanJField committed Feb 24, 2024
1 parent c01280a commit abb4a96
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data_management/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,4 @@ def external_object(request, alternate_identifier, title, version):
def logout(request):
"""Logs out user"""
auth_logout(request)
return redirect("/")
return redirect(request.META.get('HTTP_REFERER', '/'))
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<span class="navbar-text">
{% if user.is_authenticated %}
Logged in as: {{ user.username }}
<a href="logout?next={{ request.get_full_path|urlencode }}">logout</a>
<a href="logout">logout</a>
{% else %}
{% is_auth_method "GitHub" as is_github %}
{% if is_github %}
Expand Down
2 changes: 1 addition & 1 deletion templates/rest_framework/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<span class="navbar-text">
{% if user.is_authenticated %}
Logged in as: {{ user.username }}
<a href="logout?next={{ request.get_full_path|urlencode }}">logout</a>
<a href="logout">logout</a>
{% else %}
{% is_auth_method "GitHub" as is_github %}
{% if is_github %}
Expand Down

0 comments on commit abb4a96

Please sign in to comment.