summaryrefslogtreecommitdiff
path: root/frontend/admin
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/admin')
-rw-r--r--frontend/admin/admin.js9
-rw-r--r--frontend/admin/index.html3
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>