summaryrefslogtreecommitdiff
path: root/frontend/admin/admin.js
blob: ffe44c24ff6c85de9bc6c1c2adb3f78289ca6dc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const API_URL = "https://backend.laundryweb.altafcreator.com"

async function login() {
	const field = document.getElementById("pwfield");

	const response = await fetch(`${API_URL}/admin_login`, {
		method: "POST",
		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);
}