@@ -70,6 +70,9 @@
|
|||||||
document.getElementById('statusText').textContent = 'Login warning';
|
document.getElementById('statusText').textContent = 'Login warning';
|
||||||
var warningModal = new bootstrap.Modal(document.getElementById('externalWarningModal'));
|
var warningModal = new bootstrap.Modal(document.getElementById('externalWarningModal'));
|
||||||
warningModal.show();
|
warningModal.show();
|
||||||
|
document.getElementById('externalWarningModal').addEventListener('shown.bs.modal', function () {
|
||||||
|
document.getElementById('confirmExternalRedirect').focus();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// Redirect the user to the URL
|
// Redirect the user to the URL
|
||||||
window.location.href = redirectUrl;
|
window.location.href = redirectUrl;
|
||||||
@@ -82,10 +85,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('confirmExternalRedirect').addEventListener('click', function() {
|
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(() => {
|
fetch('/api/login/confirm_external_redirect.php', { method: 'POST' }).then(() => {
|
||||||
window.location.href = pendingRedirectUrl;
|
window.location.href = pendingRedirectUrl;
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
// Call the function on page load
|
// Call the function on page load
|
||||||
redirect();
|
redirect();
|
||||||
|
|||||||
Reference in New Issue
Block a user