adding user confirmation for external domains
Deploy / deploy (push) Successful in 31s

This commit is contained in:
2026-05-07 22:45:43 +02:00
parent 1d67a0810d
commit 38cb9bf81f
7 changed files with 172 additions and 9 deletions
+7 -1
View File
@@ -45,6 +45,7 @@
<script>
const redirect_api="/api/login/redirect.php";
let pendingRedirectUrl = null;
let pendingDomain = null;
async function redirect() {
try {
@@ -65,6 +66,7 @@
if (redirectUrl) {
if (data.message === 'external_redirect_warning') {
pendingRedirectUrl = redirectUrl;
pendingDomain = data.domain;
document.getElementById('externalDomainDisplay').textContent = data.domain;
document.getElementById('loadingSpinner').style.display = 'none';
document.getElementById('statusText').textContent = 'Login warning';
@@ -95,7 +97,11 @@
});
function confirmExternalRedirect() {
fetch('/api/login/confirm_external_redirect.php', { method: 'POST' }).then(() => {
fetch('/api/login/confirm_external_redirect.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ domain: pendingDomain })
}).then(() => {
window.location.href = pendingRedirectUrl;
});
}