Skip to content

Commit

Permalink
Support Django logout redirects (ansible#15148)
Browse files Browse the repository at this point in the history
* Allowed hosts for logout redirects can now be set via the LOGOUT_ALLOWED_HOSTS setting

Authored-by: Michael Anstis <[email protected]>
Co-authored-by: Hao Liu <[email protected]>
  • Loading branch information
2 people authored and djyasin committed Nov 11, 2024
1 parent 77ec57c commit 0666d62
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 = []

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

0 comments on commit 0666d62

Please sign in to comment.