Hello Experts,
Please help me with the implementation of following requirement in D365 Portals:
If User is not logged in, they should be redirected directly to sign in page on entering the portal URL
Else
If User has signed in, then they should be redirected to the home page.
Hi Mahender,
Thanks a lot for your response. This worked for me.
Actually I was trying with the following code in Custom Javascript of Home web page
{% if user %}
{% else if %}
window.open('https://'+window.location.host+'/SignIn?returnUrl='+window.location.pathname,'_self');
{% endif %}
This did not work as the Signin page is continuously blinking.
But your code in Home web template worked.
Thanks Again!
Hi DevDynm,
You can use user(docs.microsoft.com/.../liquid-objects) object to identify if user is signed in or not, you can use following script on your the web template
{% if user %}
{% else %}
window.location.href = "/SignIn?returnUrl=%2F"; //redirect them to sign page
{% endif %}