Skip to content

Commit 878494e

Browse files
committed
relay state needed prior to calling custom redirect
1 parent 8d9c975 commit 878494e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

djangosaml2/views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,10 @@ def post(self,
339339
post_authenticated.send_robust(sender=user, session_info=session_info)
340340
self.customize_session(user, session_info)
341341

342+
relay_state = self.build_relay_state()
342343
custom_redirect_url = self.custom_redirect(user, relay_state)
343344
if custom_redirect_url:
344345
return HttpResponseRedirect(custom_redirect_url)
345-
346-
relay_state = self.build_relay_state()
347346
if not is_safe_url_compat(url=relay_state, allowed_hosts={self.request.get_host()}):
348347
relay_state = settings.LOGIN_REDIRECT_URL
349348
logger.debug('Redirecting to the RelayState: %s', relay_state)

0 commit comments

Comments
 (0)