Update login.html
Browse files- login.html +4 -4
login.html
CHANGED
|
@@ -50,9 +50,8 @@
|
|
| 50 |
e.preventDefault();
|
| 51 |
const formData = new FormData(e.target);
|
| 52 |
const data = Object.fromEntries(formData.entries());
|
| 53 |
-
// Add your login API call here
|
| 54 |
// Send login data to the server
|
| 55 |
-
fetch('https://
|
| 56 |
method: 'POST',
|
| 57 |
headers: {
|
| 58 |
'Content-Type': 'application/json',
|
|
@@ -62,8 +61,9 @@
|
|
| 62 |
.then(response => response.json())
|
| 63 |
.then(data => {
|
| 64 |
if (data.success) {
|
| 65 |
-
|
| 66 |
-
|
|
|
|
| 67 |
} else {
|
| 68 |
alert(data.message);
|
| 69 |
}
|
|
|
|
| 50 |
e.preventDefault();
|
| 51 |
const formData = new FormData(e.target);
|
| 52 |
const data = Object.fromEntries(formData.entries());
|
|
|
|
| 53 |
// Send login data to the server
|
| 54 |
+
fetch('https://thevera-botveradb.hf.space/login', {
|
| 55 |
method: 'POST',
|
| 56 |
headers: {
|
| 57 |
'Content-Type': 'application/json',
|
|
|
|
| 61 |
.then(response => response.json())
|
| 62 |
.then(data => {
|
| 63 |
if (data.success) {
|
| 64 |
+
alert("Login successful!");
|
| 65 |
+
localStorage.setItem('token', data.token); // Store token in localStorage
|
| 66 |
+
window.location.href = "https://thevera-botveraai.static.hf.space"; // Redirect to the dashboard
|
| 67 |
} else {
|
| 68 |
alert(data.message);
|
| 69 |
}
|