Fixed hash not being applied on login

This commit is contained in:
Risto Lahtela 2021-01-31 16:48:51 +02:00
parent 80cf3fcdf6
commit a2708c9113

View File

@ -50,7 +50,11 @@
if (json && json.success) {
const urlParams = new URLSearchParams(window.location.search);
const cameFrom = urlParams.get('from');
window.location.href = cameFrom && !cameFrom.startsWith("http") ? cameFrom : './';
if (cameFrom && !cameFrom.startsWith("http")) {
window.location.href = cameFrom + (window.location.hash ? window.location.hash : '');
} else {
window.location.href = './';
}
} else {
return displayError('Login failed: ' + json.error);
}