diff --git a/README.md b/README.md new file mode 100644 index 0000000..a6781de --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Made by a clanker. It's just a stupid project not made for public use, but im making it public anyways. + +Recreated the API for https://xcs.restrafes.co/ and had Copilot make the frontend cause i suck at frontend. diff --git a/public/dashboard.html b/public/dashboard/index.html similarity index 100% rename from public/dashboard.html rename to public/dashboard/index.html diff --git a/public/index.html b/public/index.html index 1738f41..e30a8b6 100644 --- a/public/index.html +++ b/public/index.html @@ -5,8 +5,8 @@ NOTXCS diff --git a/public/js/dashboard.js b/public/js/dashboard.js index ed838a4..148f58e 100644 --- a/public/js/dashboard.js +++ b/public/js/dashboard.js @@ -18,7 +18,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; @@ -27,7 +27,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; } currentUser = me.user; @@ -209,7 +209,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 --- diff --git a/public/js/login.js b/public/js/login.js index 00dd1d0..7e360c3 100644 --- a/public/js/login.js +++ b/public/js/login.js @@ -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'); diff --git a/public/js/register.js b/public/js/register.js index 370c434..ab44909 100644 --- a/public/js/register.js +++ b/public/js/register.js @@ -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'); diff --git a/public/login.html b/public/login/index.html similarity index 97% rename from public/login.html rename to public/login/index.html index d9c7eb2..6995329 100644 --- a/public/login.html +++ b/public/login/index.html @@ -21,7 +21,7 @@ - + diff --git a/public/preview.html b/public/preview/index.html similarity index 100% rename from public/preview.html rename to public/preview/index.html diff --git a/public/register.html b/public/register/index.html similarity index 97% rename from public/register.html rename to public/register/index.html index 0de45cb..41792bd 100644 --- a/public/register.html +++ b/public/register/index.html @@ -21,7 +21,7 @@ - +