52 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<title>Seera Apps</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: #f0f4f8;
display: flex; align-items: center; justify-content: center;
min-height: 100vh;
}
.wrap { text-align: center; padding: 24px; }
.spinner {
width: 44px; height: 44px;
border: 3px solid #dde3ed; border-top-color: #1a3a5c;
border-radius: 50%; animation: spin 0.8s linear infinite;
margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
p { color: #888; font-size: 15px; }
</style>
</head>
<body>
<div class="wrap">
<div class="spinner"></div>
<p>Checking your session...</p>
</div>
<script>
fetch('/api/method/frappe.auth.get_logged_user', {
credentials: 'include',
signal: AbortSignal.timeout(5000)
})
.then(r => r.json())
.then(data => {
if (data.message && data.message !== 'Guest') {
// Session alive → go to dashboard
window.location.href = '/asm_app/dashboard';
} else {
// Not logged in → YOUR React login page
window.location.href = '/asm_app/login';
}
})
.catch(() => {
window.location.href = '/asm_app/login';
});
</script>
</body>
</html>