Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Loggin in as a different user

$
0
0

Hello ,

I want a link that the users can click which supports logging in as a different user and then redirects them back to the same page.The issue is the page currently the user is on is also a layouts page .So the below code will work but take the user to the home page not the layouts page they are currently on which is

http://test.net/_layouts/15/EditProfile.aspx

function ChangeLogin()
{
    var url = window.location.host;
    alert(url);
    var loginurl ="http://" + url + '/_layouts/closeConnection.aspx?loginasanotheruser=true'
   
      location.href = loginurl;

}

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>