diff options
| author | altaf-creator <dev@altafcreator.com> | 2026-01-21 20:30:38 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2026-01-21 20:30:38 +0800 |
| commit | 676c8584bb3f9db8a18718c7827f8ad1086df041 (patch) | |
| tree | ede96b51a2c07b69ab4314071b880543ef9169ff | |
| parent | ba5110a61319b8a1cda213f8341b7443faf8eaab (diff) | |
login status
| -rw-r--r-- | frontend/admin/admin.js | 9 | ||||
| -rw-r--r-- | frontend/admin/index.html | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/frontend/admin/admin.js b/frontend/admin/admin.js index eda55db..ffe44c2 100644 --- a/frontend/admin/admin.js +++ b/frontend/admin/admin.js @@ -5,10 +5,17 @@ async function login() { const response = await fetch(`${API_URL}/admin_login`, { method: "POST", - credentials: "include", headers: { "Content-Type": "application/json" }, body: `{"password": "${field.value}"}`, }); } + +async function checkLoginStatus() { + const response = await fetch(`${API_URL}/admin_check`, { + method: "POST", + credentials: "include" + }); + console.log(response); +} diff --git a/frontend/admin/index.html b/frontend/admin/index.html index 8d415a1..8ce5812 100644 --- a/frontend/admin/index.html +++ b/frontend/admin/index.html @@ -9,5 +9,8 @@ <h1>LaundryWeb Admin Panel Log In</h1> <input type="password" id="pwfield"> <button onclick="login()">Log In</button> <script src="./admin.js"></script> + <script> + checkLoginStatus(); + </script> </body> </html> |
