From d22a55d52c425d6195dbe00566c71c2a8696a208 Mon Sep 17 00:00:00 2001 From: AkisYTB3 Date: Fri, 19 Jan 2024 12:16:20 +0100 Subject: [PATCH] login test gpt chat ai helped (did everyhtging t) --- assets/login-script.js | 29 +++++++++++++++++++++++++++++ templates/login.html | 22 +++++++++++++++------- 2 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 assets/login-script.js diff --git a/assets/login-script.js b/assets/login-script.js new file mode 100644 index 0000000..afced83 --- /dev/null +++ b/assets/login-script.js @@ -0,0 +1,29 @@ +function login() { + var email = document.getElementById("email").value; + var password = document.getElementById("password").value; + + // 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: JSON.stringify({ + action: 'login', + email: email, + password: password + }), + }) + .then(response => response.json()) + .then(data => { + if (data.status === 'success') { + document.getElementById("statusMessage").innerText = "Login successful!"; + // Redirect or perform other actions after successful login + } else { + document.getElementById("statusMessage").innerText = "Login failed. Please check your credentials."; + } + }) + .catch((error) => { + console.error('Error:', error); + }); +} diff --git a/templates/login.html b/templates/login.html index 305f9c6..45361bb 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,7 +1,15 @@ -
-
-
-
-
- -
\ No newline at end of file +
+

Login

+
+ + + + + + + +
+

+
+ + \ No newline at end of file