0

I've created a custom login page for FBA which has this hyperlink for windows login: /_windows/default.aspx?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F&Source=%2F . When we try accessing any other site collection using windows authentication it redirects to the root site. I'm trying to use Omegacron's Javascript to fix the issue of site redirection to the root site as mentioned here: Sharepoint 2013 mixed mode authentication custom login

<script>
function employeeLogin(){
 var winURL =  window.location.href;
 var dPos =  winURL.indexOf("Authenticate.aspx");
 var dest = winURL.substring(dPos + 37);
 var newURL = "https://mysiteurl/_windows/default.aspx?ReturnUrl=%2f_layouts%2fAuthenticate.aspx" + dest;
 window.location.href = newURL;
}
</script>

I created a Redirect.js file and added it to the custom Login page solution.
Added this line to the custom page:
<script type="text/javascript" src="DesignFiles\Scripts\Redirect.js"></script>.
It's not calling the employeeLogin function.

What am I missing?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.