88 lines
2.1 KiB
Plaintext
88 lines
2.1 KiB
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Logout</title>
|
|
<style>
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100vh;
|
|
margin: 0;
|
|
background: #f5f5f5;
|
|
}
|
|
.logout-container {
|
|
text-align: center;
|
|
background: white;
|
|
padding: 40px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
}
|
|
h1 { color: #333; margin-bottom: 20px; }
|
|
p { color: #666; margin-bottom: 30px; }
|
|
a {
|
|
display: inline-block;
|
|
padding: 12px 24px;
|
|
background: #007bff;
|
|
color: white;
|
|
text-decoration: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
}
|
|
a:hover { background: #0056b3; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="logout-container">
|
|
<h1>Logged Out</h1>
|
|
<p>You have been successfully logged out.</p>
|
|
<p>Please close your browser to completely clear the authentication cache.</p>
|
|
<a onclick="loginAgain()">Login Again</a>
|
|
</div>
|
|
<script>
|
|
// Try to clear authentication cache
|
|
sessionStorage.clear();
|
|
localStorage.clear();
|
|
|
|
// Clear cookies
|
|
document.cookie.split(';').forEach(function(c) {
|
|
document.cookie = c.trim().split('=')[0] + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
|
|
});
|
|
|
|
// Force browser to clear Basic Auth by making wrong auth request
|
|
window.addEventListener('load', function() {
|
|
// Make a request with wrong credentials to overwrite the cached ones
|
|
fetch('/', {
|
|
headers: {
|
|
'Authorization': 'Basic ' + btoa('logout:logout')
|
|
}
|
|
}).then(function() {
|
|
console.log('Auth cache cleared');
|
|
}).catch(function() {
|
|
console.log('Auth cache clear attempted');
|
|
});
|
|
});
|
|
|
|
// Login Again - force full page reload
|
|
function loginAgain() {
|
|
// Method 1: Clear all caches
|
|
if (window.caches) {
|
|
caches.keys().then(function(names) {
|
|
for (let name of names) caches.delete(name);
|
|
});
|
|
}
|
|
|
|
// Method 2: Force reload without cache
|
|
window.location.reload(true);
|
|
|
|
// Method 3: Navigate with timestamp to prevent caching
|
|
setTimeout(function() {
|
|
window.location.href = '/?_t=' + Date.now();
|
|
}, 100);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|