Skip to content
Merged
Changes from 1 commit
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
Next Next commit
added a setting for default redirection after successful authentication
  • Loading branch information
ganiserb committed Mar 16, 2016
commit a06ac89a831387ea5f9f36352fd40c0af13b9b09
3 changes: 2 additions & 1 deletion djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ def assertion_consumer_service(request,
post_authenticated.send_robust(sender=user, session_info=session_info)

# redirect the user to the view where he came from
relay_state = request.POST.get('RelayState', '/')
default_relay_state = get_custom_setting('ACS_DEFAULT_REDIRECT_URL', '/')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with this, but how about changing the '/' default to settings.LOGIN_REDIRECT_URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. It would be consistent with the lines below.

relay_state = request.POST.get('RelayState', default_relay_state)
if not relay_state:
logger.warning('The RelayState parameter exists but is empty')
relay_state = settings.LOGIN_REDIRECT_URL
Expand Down