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

7 REPLIES 7
OliverRodrigues
Super User
Super User

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


 

@VSJadhav  is '/Account/Login/LogOff?returnUrl=%2F' URL specific to your portal or common?

 

OliverRodrigues
Super User
Super User

that would be a common URL @NGeetha 




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
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,322)