fix landing page
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user