Introduction
In this blog, we will see how we can navigate to login page after once we logout from any page in Microsoft Portal.
Let’s look at the requirement where we want to provision the setup such as that the log-in page is redirected as soon the user logs out. Now, after logging again in the portal user is again redirected to the same page from where he logged out.
There are only 3 steps, which we need to be followed to cater the above requirement in our Dynamics 365 Portal.
Step 1
Go to the Web Template entity and search “header”.
Image may be NSFW.
Clik here to view.
Step 2
Open the record and find the logout section in source control.
Image may be NSFW.
Clik here to view.
Step 3
Update the href attribute of the anchor tag as below.
From: – href=”{% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_out_url_substitution }}”
Image may be NSFW.
Clik here to view.
To: –
href=”/Account/Login/LogOff?returnUrl={{ website.sign_out_url_substitution }}”
Image may be NSFW.
Clik here to view.
We have just replaced the homeurl with /Account/Login/LogOff?returnUrl=
Conclusion
This is the most precise way to set the login page as default page after logout.