Skip to content

Commit

Permalink
Support Django logout redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
manstis committed May 12, 2024
1 parent 946bbe3 commit 01ae1a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions awx/api/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def post(self, request, *args, **kwargs):


class LoggedLogoutView(auth_views.LogoutView):

success_url_allowed_hosts = settings.LOGOUT_ALLOWED_HOSTS

def dispatch(self, request, *args, **kwargs):
original_user = getattr(request, 'user', None)
ret = super(LoggedLogoutView, self).dispatch(request, *args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions awx/settings/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
MEDIA_URL = '/media/'

LOGIN_URL = '/api/login/'
LOGOUT_ALLOWED_HOSTS = os.getenv('LOGOUT_ALLOWED_HOSTS').split(",") if os.getenv('LOGOUT_ALLOWED_HOSTS') else []

# Absolute filesystem path to the directory to host projects (with playbooks).
# This directory should not be web-accessible.
Expand Down

0 comments on commit 01ae1a5

Please sign in to comment.