Improve the session context validation on the login page
var userName = document.getElementById("username");
userName.value = userName.value.trim();
if(userName.value){
+ $.ajax({
+ type: "GET",
+ url: "/logincontext?sessionDataKey=" + getParameterByName("sessionDataKey") + "&relyingParty=" + getParameterByName("relyingParty") + "&tenantDomain=" + getParameterByName("tenantDomain"),
+ success: function (data) {
+ if (data && data.status == 'redirect' && data.redirectUrl && data.redirectUrl.length > 0) {
+ window.location.href = data.redirectUrl;
+ } else {
// Mark it so that the next submit can be ignored.
$form.data('submitted', true);
document.getElementById("loginForm").submit();
}
+ },
+ cache: false
+ });
+ }
}
});
