The logout page you visit is influenced by a cookie called originURI. So, if you reset the originURI on the second login page, when the user logs out they should be sent there.
For example, see this default code in a Mendix index.html file:
<script> if (!document.cookie || !document.cookie.match(/(^|;)originURI=/gi)) document.cookie = "originURI=/login.html"; </script>
So within that second login page, if you use an HTML snippet widget, you could set the cookie to the deeplink URL, something like this:
document.cookie = "originURI=/link/mydeeplink;
Thank you it worked!
the cookie originURI was replaced after a successful login. So I put i condition to avoid that, also after a log out a wasn’t send to the url in my originURI. i Had to put an html snippet that check the value of the cookie and redirect to the correct login page if needed.
I am trying to achieve the same thing: when a custom login page is used, and the user signs out, i want him to be redirected back to the custom login page.
In the login page, i set the cookie. I checked and the originURI is set to “/p/zr” . This stays like that during the session.
However when the user signs out (the standard sign out button in the top bar, triggering the ‘sign out’ event on click) , the standard login screen is shown (not the custom one used to login).
What is not correct here?