Skip to content

Commit

Permalink
AAP-23125: Support Django logout redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Anstis authored and manstis committed May 7, 2024
1 parent 20f054d commit f587d2c
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 f587d2c

Please sign in to comment.