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

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
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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Users online (6,358)