get to specified page after login
Posted: 2020-07-03 19:58
Hi,
sometimes it is uesful to provide a link to a specific record, but when clicking on the record, you app is asking for login authentication and redirects afterwards to the index page.
To bypass this behaviour you can try this code. Add it to the hooks/header-extras.php.
sometimes it is uesful to provide a link to a specific record, but when clicking on the record, you app is asking for login authentication and redirects afterwards to the index page.
To bypass this behaviour you can try this code. Add it to the hooks/header-extras.php.
Code: Select all
<script>
var ref=window.location.href;
if (ref.includes('index.php') == 0 && $j('.navbar-text').not('.navbar-right').length == 0) {
localStorage.setItem('redirecturl', ref);
}
else {
if ($j('.navbar-text').length != 0 && ref.includes('index.php') != 0 && localStorage.hasOwnProperty("redirecturl")) {
ref=localStorage.getItem('redirecturl');
localStorage.removeItem('redirecturl');
$j(location).attr('href', ref);
}
}
</script>