Implement a bunch of stuff
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
function login(){
|
||||
const email = document.getElementById("email").value;
|
||||
const password = document.getElementById("password").value;
|
||||
doLogin(email, password);
|
||||
}
|
||||
|
||||
function doLogin(email, password) {
|
||||
|
||||
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',
|
||||
body: data,
|
||||
})
|
||||
.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);
|
||||
});
|
||||
}
|
3
assets/scripts/home/account.js
Normal file
3
assets/scripts/home/account.js
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user