This is what worked for me:
window.mx.afterLoginAction = () => {
if ( window.location.search.startsWith('?cont=') ) {
window.location = window.mx.homeUrl+decodeURIComponent(window.location.search.substring(6))
} else {
window.mx.redirect(window.mx.homeUrl);
}
}
Hope this helps
There is some similar question raised and the answer was upvoted. https://forum.mendix.com/link/questions/99330
There are some documentation available for setting the constant:
https://docs.mendix.com/appstore/modules/deep-link#2-7-constants-optional
https://appstore.home.mendix.com/link/app/43/
But having said all these, the last solution I tried and worked when I faced the same problem was, customizing the deep link login page to suite my default login page. Works seamlessly.