cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VSJadhav
Helper II
Helper II

Redirect to Home page after user login to portal

Hello Team,

I need to redirect to Home page after user successfully log-in the portal.

Problem = When user log-out from specific page then getting that page URL at sign-in page and due to this at re-login user redirecting to page where he was logged-out previously.

Let me know if there is any solutions for this issue.

Thanks,
Vaibhav 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, I just tried here the following and it worked

Instead of specifying home, I am specifying the root page with just a slash / :

<a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}/Account/Login/LogOff?returnUrl=/" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">
                                    {{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
</a>

 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

View solution in original post

5 REPLIES 5
OliverRodrigues
Super User II
Super User II

Hi, you can achieve this by changing the sign-out link on the Header Web Template.

 

Please follow this article: http://shaikhd365.blogspot.com/2019/07/redirect-to-home-page-when-logout-into.html

 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Hi @OliverRodrigues I tried by what mentioned in given link, but it changes the menu UI and also not redirected to Home page when I re-login.

Below is my code:

<a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_out_url_substitution }}" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">
{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
</a>

After Change :
<a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}/Account/Login/LogOff?returnUrl=%2home" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">

Hi, I just tried here the following and it worked

Instead of specifying home, I am specifying the root page with just a slash / :

<a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}/Account/Login/LogOff?returnUrl=/" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">
                                    {{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
</a>

 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

View solution in original post

@OliverRodrigues  Thanks for verifying . I used this and it also works.

{% assign homelink = '/Account/Login/LogOff?returnUrl=%2F' %}
<a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}{{ homelink }}" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">
{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
</a>

perfect, that's the same URL you just assigned to a variable

 

can you mark my previous reply as the answer in case other people are looking for similar results

nevermind, just saw you did this

 

thanks




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,936)