Move static pages into subfolders using index.html

This commit is contained in:
copilot-swe-agent[bot] 2026-07-02 15:08:59 +00:00 committed by GitHub
parent 7e651ace27
commit 96d8e08dbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 9 additions and 9 deletions

View file

@ -5,8 +5,8 @@
<title>NOTXCS</title>
<script>
fetch('/auth/me').then(r => r.json()).then(data => {
window.location.replace(data.success ? '/dashboard.html' : '/login.html');
}).catch(() => window.location.replace('/login.html'));
window.location.replace(data.success ? '/dashboard' : '/login');
}).catch(() => window.location.replace('/login'));
</script>
</head>
<body>

View file

@ -9,7 +9,7 @@ async function api(path, options = {}) {
});
const data = await res.json().catch(() => ({ success: false, message: 'Invalid response from server' }));
if (res.status === 401) {
window.location.href = '/login.html';
window.location.href = '/login';
throw new Error('Not authenticated');
}
return data;
@ -18,7 +18,7 @@ async function api(path, options = {}) {
async function init() {
const me = await api('/auth/me');
if (!me.success) {
window.location.href = '/login.html';
window.location.href = '/login';
return;
}
document.getElementById('username-display').textContent = me.user.username;
@ -188,7 +188,7 @@ document.getElementById('delete-place-btn').addEventListener('click', async () =
document.getElementById('logout-btn').addEventListener('click', async () => {
await api('/auth/logout', { method: 'POST' });
window.location.href = '/login.html';
window.location.href = '/login';
});
// --- ACL (allowed persons / credentials) management ---

View file

@ -20,7 +20,7 @@ document.getElementById('login-form').addEventListener('submit', async (e) => {
return;
}
window.location.href = '/dashboard.html';
window.location.href = '/dashboard';
} catch (err) {
errorEl.textContent = 'Unable to reach the server. Please try again.';
errorEl.classList.add('visible');

View file

@ -20,7 +20,7 @@ document.getElementById('register-form').addEventListener('submit', async (e) =>
return;
}
window.location.href = '/dashboard.html';
window.location.href = '/dashboard';
} catch (err) {
errorEl.textContent = 'Unable to reach the server. Please try again.';
errorEl.classList.add('visible');

View file

@ -21,7 +21,7 @@
<button type="submit" class="primary">Log in</button>
</form>
<p class="switch-link">Don't have an account? <a href="/register.html">Register</a></p>
<p class="switch-link">Don't have an account? <a href="/register">Register</a></p>
</div>
</div>
<script src="/js/login.js"></script>

View file

@ -21,7 +21,7 @@
<button type="submit" class="primary">Register</button>
</form>
<p class="switch-link">Already have an account? <a href="/login.html">Log in</a></p>
<p class="switch-link">Already have an account? <a href="/login">Log in</a></p>
</div>
</div>
<script src="/js/register.js"></script>