Updatweb
This commit is contained in:
38
website/admin/test-logout-simple.html
Normal file
38
website/admin/test-logout-simple.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user