PowerApps Portals - Change Default Landing Page For Portal Users
Views (1664)
Hi All,
Welcome to my Power Guide Mentorship Program.
Today, I am going to share a #PowerGuideTip16 for PowerApps Portal Developers, who want to manage the redirection of the Portal default landing page.
Requirement:
Redirect Anonymous Portal User to Login Page and Authenticated Portal Users to Home Page,
Solution:
Option 1 -
Anonymous User Default Landing Page - Login Page
Authenticated User Default Landing Page - OOB Home Page
Go to Portals > Web Template > Home
Update the code as per the following:
{% if user %}
//if a user is logged in then
// Paste OOB Home web template Liquid Code inside this block
{% else %}
<script>
//if user is not loggedin, redirect user to Login page
window.location.href='~/SignIn';
</script>
{% endif %}
Option 2 -
Anonymous User Default Landing Page - Login Page
Authenticated User Default Landing Page - Custom Page or other than OOB Home Page
{% if user %}
//if a user is logged
<script>
window.location.href='~/<WebpagePartialURL>';
</script>
{% else %}
<script>
//if user is not loggedin, redirect user to Login page
window.location.href='~/SignIn';
</script>
{% endif %}
This was originally posted here.
*This post is locked for comments