From 1d67a0810d2a195a076223a6741223ef58dd4a5d Mon Sep 17 00:00:00 2001 From: janis steiner Date: Thu, 7 May 2026 22:43:05 +0200 Subject: [PATCH] conffirming with enter --- app-code/login/index.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app-code/login/index.php b/app-code/login/index.php index 68408be..9759b19 100644 --- a/app-code/login/index.php +++ b/app-code/login/index.php @@ -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();