7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/searls/auth/builds_target_redirect_url.rb', line 7
def build(request, params, user: nil)
path = normalize_path(params[:redirect_path])
host = normalize_redirect_host(params[:redirect_host])
if (host.blank? || host == request.host) && path.present?
path
elsif host.present? && host != request.host
url = absolute_url(request, host, path)
if same_cookie_domain?(request, host)
url
else
append_cross_domain_sso_token(url, request, user, host) || path
end
end
end
|