Skip to content

Commit a5b50c6

Browse files
authored
Update index.html
1 parent 87ec637 commit a5b50c6

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@
5050
"password"
5151
]
5252

53-
async function hash(pass) {
54-
const hash = await bcrypt.hash(pass + noAI, 3);
55-
return hash;
53+
async function hash( pass ) {
54+
return await bcrypt.hash(pass + "noAI", 8);
5655
}
5756

58-
async function check( item, index ) {
59-
works = hash(pass) === data[index];
57+
async function check( pass ) {
58+
for (const stored of data) {
59+
const match = await bcrypt.compare(pass, stored);
60+
if (match) return true;
61+
}
62+
return false
6063
}
6164

6265
async function test() {
6366
const input = await document.getElementById("in");
64-
const password = input.innerHTML;
65-
const works = false;
66-
data.forEach( check );
67-
68-
if ( works ) {
67+
const pass = input.innerHTML;
68+
if ( check(pass) ) {
6969
window.location = "/pass.html";
7070
}
7171
}

0 commit comments

Comments
 (0)