-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassword.js
24 lines (21 loc) · 885 Bytes
/
password.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
let lsdata = JSON.parse(localStorage.getItem("userdata")) || [];
let passinp = document.getElementById("pass");
let continuebtn = document.getElementById("continue");
let email = document.getElementById("email");
email.innerText = JSON.parse(localStorage.getItem("email"));
continuebtn.addEventListener("click", function () {
let check = false;
lsdata.forEach((e) => {
if (e.email == email.innerText) {
if (e.password == passinp.value) {
localStorage.setItem("username", e.first);
check = true;
}
}
})
if (check) {
if (email.innerText == "sunilsinghtarkar1@gmail.com") window.location.href = "./admin.html";
else window.location.href = "./index.html";
}
else alert("Wrong Password");
})