Preview:
/* Added for B2C login links */
$("#samlSignInLink,#samlSignInLinkPopUp,#samlSignInLinkHomepage").off('click', function (e) {
	  
});



$("#samlSignInLink,#samlSignInLinkPopUp,#samlSignInLinkHomepage").on('click', function (e) {
	var redirectUrl;
	var currentPath = document.location.pathname == '/error' ? '' : document.location.pathname;
	var queryString = window.location.search;
	if(queryString) {
		redirectUrl = document.location.origin + "/samlsinglesignon/saml" + currentPath + queryString +"&"
	} else {
		redirectUrl = document.location.origin + "/samlsinglesignon/saml" + currentPath + "?"
	}
	if ($('#isDeviceApp').val() == 'true') {
		redirectUrl =redirectUrl + "idp=B2C_1A_signup_signin_SAML_APP_KMSI"
	} else if ($('#isMobileBrowser').val() == 'true') {
		redirectUrl = redirectUrl + "idp=B2C_1A_signup_signin_SAML_MOBILE"
	} else {
		redirectUrl = redirectUrl + "idp=B2C_1A_signup_signin_SAML"
	}
	

	if(window.parent.location.href.indexOf('smartedit') >= 0){
		localStorage.setItem("SE_login", true);
		console.log("set SE_login TRUE")
		window.open(redirectUrl, '_blank');
	}else{
		window.location.href = redirectUrl;
	}

});


if(localStorage.getItem("SE_login") != null && JSON.parse(localStorage.getItem("SE_login")) == true){
	localStorage.setItem("SE_login", false);
	console.log("set SE_login FALSE")

	window.opener.location.reload();
	window.close();
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter