Fixed RedirectUrl not working

This commit is contained in:
2025-12-05 09:47:31 +01:00
parent dc5cdb2c56
commit 9b906cbf14

View File

@@ -55,7 +55,8 @@ document.getElementById('loginForm').addEventListener('submit', async (e) => {
}); });
if (response.ok) { if (response.ok) {
window.location.href = '/'; let returnUrl = new URLSearchParams(window.location.search).get('ReturnUrl');
window.location.href = returnUrl ? returnUrl : '/';
} else { } else {
const error = await response.json(); const error = await response.json();
messageDiv.innerHTML = `<div class="alert alert-danger">${error.message}</div>`; messageDiv.innerHTML = `<div class="alert alert-danger">${error.message}</div>`;