mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 20:05:03 -02:30
Support Django logout redirects (#15148)
* Allowed hosts for logout redirects can now be set via the LOGOUT_ALLOWED_HOSTS setting Authored-by: Michael Anstis <manstis@redhat.com> Co-authored-by: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com>
This commit is contained in:
@@ -109,6 +109,9 @@ class LoggedLoginView(auth_views.LoginView):
|
|||||||
|
|
||||||
|
|
||||||
class LoggedLogoutView(auth_views.LogoutView):
|
class LoggedLogoutView(auth_views.LogoutView):
|
||||||
|
|
||||||
|
success_url_allowed_hosts = settings.LOGOUT_ALLOWED_HOSTS
|
||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
original_user = getattr(request, 'user', None)
|
original_user = getattr(request, 'user', None)
|
||||||
ret = super(LoggedLogoutView, self).dispatch(request, *args, **kwargs)
|
ret = super(LoggedLogoutView, self).dispatch(request, *args, **kwargs)
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'public', 'media')
|
|||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
|
|
||||||
LOGIN_URL = '/api/login/'
|
LOGIN_URL = '/api/login/'
|
||||||
|
LOGOUT_ALLOWED_HOSTS = []
|
||||||
|
|
||||||
# Absolute filesystem path to the directory to host projects (with playbooks).
|
# Absolute filesystem path to the directory to host projects (with playbooks).
|
||||||
# This directory should not be web-accessible.
|
# This directory should not be web-accessible.
|
||||||
|
|||||||
Reference in New Issue
Block a user