Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,10 @@ def post_login_hook(self, request: HttpRequest, user: settings.AUTH_USER_MODEL,
def build_relay_state(self) -> str:
""" The relay state is a URL used to redirect the user to the view where they came from.
"""
login_redirect_url = get_custom_setting('LOGIN_REDIRECT_URL', '/')
default_relay_state = get_custom_setting(
'ACS_DEFAULT_REDIRECT_URL', settings.LOGIN_REDIRECT_URL)
relay_state = self.request.POST.get('RelayState', '/')
'ACS_DEFAULT_REDIRECT_URL', login_redirect_url)
relay_state = self.request.POST.get('RelayState', default_relay_state)
relay_state = self.customize_relay_state(relay_state)
if not relay_state:
logger.warning('The RelayState parameter exists but is empty')
Expand Down