From 1510e416a6f2ce0d08bb6a050c1090b9bd6bfec5 Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 2 Feb 2024 12:28:37 +0100 Subject: [PATCH] convert to jsonless --- assets/scripts/global/account.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/assets/scripts/global/account.js b/assets/scripts/global/account.js index 054da98..f9d71aa 100644 --- a/assets/scripts/global/account.js +++ b/assets/scripts/global/account.js @@ -2,17 +2,15 @@ function login() { const email = document.getElementById("email").value; const password = document.getElementById("password").value; + const data = new URLSearchParams(); + data.append("action", "login"); + data.append("email", email); + data.append("password", password); + // Assuming you use fetch API to send data to the server fetch('https://home.adlerka.top/account', { method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: { - action: 'login', - email: email, - password: password - }, + body: data, }) .then(response => response.json()) .then(data => {