fix landing page

This commit is contained in:
Stefano Manfredi
2025-12-02 23:18:43 +00:00
parent 7168fa4b72
commit ce9e2fdf2a
17 changed files with 727 additions and 457 deletions

View File

@@ -42,11 +42,29 @@
<script src="/js/api.js"></script>
<script>
// Redirect if already logged in
if (api.isAuthenticated()) {
window.location.href = '/presence';
async function init() {
// Redirect if already logged in
if (api.isAuthenticated()) {
window.location.href = '/presence';
return;
}
// Check auth mode - if Authelia enabled, redirect to external registration portal
try {
const configResponse = await fetch('/api/auth/config');
const config = await configResponse.json();
if (config.authelia_enabled && config.registration_url) {
window.location.href = config.registration_url;
return;
}
} catch (e) {
// Continue with local registration
}
}
init();
document.getElementById('registerForm').addEventListener('submit', async (e) => {
e.preventDefault();