Spaces:
Sleeping
Sleeping
| <html> | |
| <head> | |
| <title>Password Checker</title> | |
| </head> | |
| <body> | |
| <h1>Password Checker</h1> | |
| <input type="password" id="passwordInput" placeholder="Enter your password"> | |
| <button onclick="checkPassword()">Check Password</button> | |
| <p id="result"></p> | |
| <script> | |
| async function checkPassword() { | |
| const password = document.getElementById('passwordInput').value; | |
| const response = await fetch('/checkPassword', { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| }, | |
| body: JSON.stringify({ password }) | |
| }); | |
| const data = await response.json(); | |
| document.getElementById('result').innerText = data.breached ? `Password breached ${data.breachCount} times` : 'Password is secure'; | |
| } | |
| </script> | |
| </body> | |
| </html> |