Skip to content

Commit

Permalink
Confirm password spam protection #175
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jan 9, 2022
1 parent 60071f5 commit d1f02d4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/confirm/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,23 @@ const check_integrity = () => {
/**
* Compare passwords
*/
let tries = 0

const unhashPassword = async () => {
if (integrity === false) {
check_integrity()
}

if (tries === 5) {
setTimeout(() => {
tries = 3

text.textContent = "Try again!"
}, 5000)

return (text.textContent = "Please try again in 5 seconds!")
}

// read settings
settings = JSON.parse(fs.readFileSync(path.join(folder_path, "settings", "settings.json"), "utf-8"))

Expand All @@ -154,6 +166,8 @@ const unhashPassword = async () => {

text.style.color = "#CC001B"
text.textContent = "Passwords don't match! Try again!"

tries++
}
}

Expand Down

0 comments on commit d1f02d4

Please sign in to comment.