add return to

This commit is contained in:
Karol Wypchlo 2022-05-20 15:04:13 +02:00
parent d6bfb50516
commit ab317b428a
No known key found for this signature in database
GPG Key ID: B515DE9EEBE241E1
1 changed files with 2 additions and 1 deletions

View File

@ -81,7 +81,8 @@
// prevent auto redirect if not on portal domain to allow local development
if (window.location.hostname.endsWith("${PORTAL_DOMAIN}")) {
setTimeout(function redirect() {
window.location.href = "https://account.${PORTAL_DOMAIN}/auth/login";
const encodedReturnTo = encodeURIComponent(window.location.href);
window.location.href = `https://account.${PORTAL_DOMAIN}/auth/login?return_to=${encodedReturnTo}`;
}, 5000); // redirect after 5 secons
}
</script>