Spaces:
Sleeping
Sleeping
Create index.html
Browse files- index.html +27 -0
index.html
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<title>Password Checker</title>
|
| 5 |
+
</head>
|
| 6 |
+
<body>
|
| 7 |
+
<h1>Password Checker</h1>
|
| 8 |
+
<input type="password" id="passwordInput" placeholder="Enter your password">
|
| 9 |
+
<button onclick="checkPassword()">Check Password</button>
|
| 10 |
+
<p id="result"></p>
|
| 11 |
+
|
| 12 |
+
<script>
|
| 13 |
+
async function checkPassword() {
|
| 14 |
+
const password = document.getElementById('passwordInput').value;
|
| 15 |
+
const response = await fetch('/checkPassword', {
|
| 16 |
+
method: 'POST',
|
| 17 |
+
headers: {
|
| 18 |
+
'Content-Type': 'application/json'
|
| 19 |
+
},
|
| 20 |
+
body: JSON.stringify({ password })
|
| 21 |
+
});
|
| 22 |
+
const data = await response.json();
|
| 23 |
+
document.getElementById('result').innerText = data.breached ? `Password breached ${data.breachCount} times` : 'Password is secure';
|
| 24 |
+
}
|
| 25 |
+
</script>
|
| 26 |
+
</body>
|
| 27 |
+
</html>
|