Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

When users press sign out, they should get signed out and directed to the sign in page, how do I achieve this?

Posted on by 10

I hope everyone is well.

Currently I'm stuck on HTML pathing, in short I want to always be taken back to "SignIn" page when I log out from anywhere on Dyanimcs CRM Portals. My current customised Web Template "Header" functionality does the following.

1. Logs users out from the CRM portal and takes them to the Sign In page, when they are in 1 url path i.e. "Home/1URL/" i.e. https://test.microsoftcrmportals.com/support/ OR https://test.microsoftcrmportals.com/profile/ click sign out it, logs me out and does take me to https://test.microsoftcrmportals.com/SignIn which is all correct.

2. However when their are 2 URLS now i.e. https://test.microsoftcrmportals.com/support/edit-case/ "Home/1URL/2URL/" my logic breaks and throws and error, not logging the user out, it basicaly does not recognise the 2URL not being able to find the page.

How do I always tell to my code to always root to home then SignIn url, because currently my code gets confused when its in multiple paths i.e. like the above?

My web template header code below:

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans