Mendix 10.6 Deeplink Deprecated - Function replaced by page URLs and Microflow URLs.

7
Hi everyone,    As per the deeplink documentation, https://docs.mendix.com/appstore/modules/deep-link/ This module is deprecated from Studio Pro 10.6.0. It is replaced by page URLs and microflow URLs.   When we use deeplink, we are able to  1. click on the link 2. directed to login page 3. sign in 4. access the page   However, I'm encountering an issue using 10.6, page url, where post login, I'm redirected to the homepage instead. This issue is not encountered if I'm using the default login page, but only happens when I use the custom login page.    Any ideas on a workaround?
asked
3 answers
0

Yea I can see what you mean, the mendix default login page works but not for a custom sign in page set in app how strange. Hope they fix that!

answered
0

See if it helps if you put the javascript below in a HTMLSnippet on your custom login page. It was posted some time ago on the forum when deeplink also didn't redirect after login. Can't find the source of course, the search functionality on this forum is suboptimal to say the least. But we still have it in our custom login page, albeit in 9.24. If your login page url was appended with ?cont= etc (meaning there was a deeplink involved) it will redirect to this deeplink again explicitly after login. If you set your LoginLocation constant differently, you'll need to edit this script accordingly. Replace ?cont= on the 2nd line with whatever you use and replace the 6 on the 3rd line with the length of whatever you replaced ?cont= with.

 

window.mx.afterLoginAction = () => {

  if ( window.location.search.startsWith('?cont=') ) {

     var deeplink = decodeURIComponent(window.location.search.substring(6));

     deeplink = (deeplink.startsWith('/')) ? deeplink : '/' + deeplink;

     window.location = window.location.protocol + '//' + window.location.host + deeplink

  } else {

     window.mx.redirect(window.mx.homeUrl);

  }

}

answered
0

The issue was fixed in 10.8.0 https://docs.mendix.com/releasenotes/studio-pro/10.8/ 

  • We fixed an issue where you were not redirected to the page you had initially tried accessing after logging in via a custom login page. (Ticket 205091)
answered