conffirming with enter
Deploy / deploy (push) Successful in 32s

This commit is contained in:
2026-05-07 22:43:05 +02:00
parent 1224569e55
commit 1d67a0810d
+14 -1
View File
@@ -70,6 +70,9 @@
document.getElementById('statusText').textContent = 'Login warning';
var warningModal = new bootstrap.Modal(document.getElementById('externalWarningModal'));
warningModal.show();
document.getElementById('externalWarningModal').addEventListener('shown.bs.modal', function () {
document.getElementById('confirmExternalRedirect').focus();
});
} else {
// Redirect the user to the URL
window.location.href = redirectUrl;
@@ -82,10 +85,20 @@
}
document.getElementById('confirmExternalRedirect').addEventListener('click', function() {
confirmExternalRedirect();
});
document.addEventListener('keydown', function(e) {
if (e.key === 'Enter' && document.getElementById('externalWarningModal').classList.contains('show')) {
confirmExternalRedirect();
}
});
function confirmExternalRedirect() {
fetch('/api/login/confirm_external_redirect.php', { method: 'POST' }).then(() => {
window.location.href = pendingRedirectUrl;
});
});
}
// Call the function on page load
redirect();