If relay_state isn't part of the outgoing request, it won't come back as a response. In that case, the code wouldn't work.
I have renamed the relay_state to its semantic meaning redirect_to, and adjusted the code so that it conforms with the method's comments.
This behavior occurs when SERVER_NAME is not specified in the configuration, which also affects get_login_return_url though - in that case, no URL will pass the is_valid_redirect_url validation, as the code calls make_absolute_url which needs the server name set to work properly.
If
relay_state
isn't part of the outgoing request, it won't come back as a response. In that case, the code wouldn't work.I have renamed the
relay_state
to its semantic meaningredirect_to
, and adjusted the code so that it conforms with the method's comments.This behavior occurs when
SERVER_NAME
is not specified in the configuration, which also affectsget_login_return_url
though - in that case, no URL will pass theis_valid_redirect_url
validation, as the code callsmake_absolute_url
which needs the server name set to work properly.