-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.html
29 lines (27 loc) · 955 Bytes
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<body>
<div style="position: relative; top: 20%;">
<center>
<h2>PwnedPass Check (onblur)</h2>
<input type="password" onblur=CheckPass(this.value) oninput=ClearPassInfo()>
<div style="height: 1em; margin-bottom:2em;" id=passwordInfo></div>
<a href="https://haveibeenpwned.com/Passwords">Data Source</a>
</center>
</div>
</body>
<script src="pwnedpass.js"></script>
<script>
PwnedPass.setUserAgent("PwnedPass-Demo-App");
var infodiv = document.getElementById("passwordInfo");
function CheckPass(password) {
PwnedPass.check(password,
{
Pwned: function (count) { infodiv.innerHTML = "This password is compromised, count = " + count; },
Clean: function () { infodiv.innerHTML = "This password is clean"; }
});
}
function ClearPassInfo() {
infodiv.innerHTML = "";
}
</script>
</html>