39 lines
1.1 KiB
HTML
39 lines
1.1 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<title>Logout Test</title>
|
||
|
|
<script src="/admin/js/auth.js"></script>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<h1>Simple Logout Test</h1>
|
||
|
|
<button onclick="testLogout()">Test Logout</button>
|
||
|
|
<div id="output"></div>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
function log(msg) {
|
||
|
|
const output = document.getElementById('output');
|
||
|
|
output.innerHTML += msg + '<br>';
|
||
|
|
console.log(msg);
|
||
|
|
}
|
||
|
|
|
||
|
|
async function testLogout() {
|
||
|
|
log('Starting logout test...');
|
||
|
|
log('typeof window.logout: ' + typeof window.logout);
|
||
|
|
log('typeof logout: ' + typeof logout);
|
||
|
|
|
||
|
|
if (typeof window.logout === 'function') {
|
||
|
|
log('Calling window.logout(true)...');
|
||
|
|
try {
|
||
|
|
await window.logout(true);
|
||
|
|
log('Logout succeeded!');
|
||
|
|
} catch (err) {
|
||
|
|
log('Logout error: ' + err.message);
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
log('ERROR: window.logout is not a function!');
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|