cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

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
Highlighted
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


 

Highlighted

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 }}">
Highlighted

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

Highlighted

@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>
Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (5,953)