This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user