Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable password strength check #1622

Merged
merged 2 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions ui/components/Keyring/KeyringSetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
selectDefaultWallet,
} from "@tallyho/tally-background/redux-slices/ui"
import { useHistory } from "react-router-dom"
import zxcvbn from "zxcvbn"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove it from package.json too or nah?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah - good catch

import {
useBackgroundDispatch,
useAreKeyringsUnlocked,
Expand Down Expand Up @@ -36,21 +35,14 @@ export default function KeyringSetPassword(): ReactElement {
}, [history, areKeyringsUnlocked])

const validatePassword = (): boolean => {
if (password.length < 12) {
// Less than 12 won't reliably give users a score of 3 or more.
setPasswordErrorMessage("Must be at least 12 characters")
if (password.length < 8) {
setPasswordErrorMessage("Must be at least 8 characters")
return false
}
if (password !== passwordConfirmation) {
setPasswordErrorMessage("Passwords don’t match")
return false
}
const evaluation = zxcvbn(password)

if (evaluation.score < 3) {
setPasswordErrorMessage("Password too weak")
return false
}
return true
}

Expand Down
4 changes: 1 addition & 3 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@
"react-router-dom": "^5.3.0",
"react-transition-group": "^4.4.2",
"redux": "^4.1.0",
"webextension-polyfill": "^0.8.0",
"zxcvbn": "^4.4.2"
"webextension-polyfill": "^0.8.0"
},
"devDependencies": {
"@types/react-dom": "^17.0.9",
"@types/react-transition-group": "^4.4.4",
"@types/zxcvbn": "^4.4.1",
"webext-redux": "^2.1.7"
}
}
10 changes: 0 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3593,11 +3593,6 @@
dependencies:
"@types/yargs-parser" "*"

"@types/zxcvbn@^4.4.1":
version "4.4.1"
resolved "https://registry.yarnpkg.com/@types/zxcvbn/-/zxcvbn-4.4.1.tgz#46e42cbdcee681b22181478feaf4af2bc4c1abd2"
integrity sha512-3NoqvZC2W5gAC5DZbTpCeJ251vGQmgcWIHQJGq2J240HY6ErQ9aWKkwfoKJlHLx+A83WPNTZ9+3cd2ILxbvr1w==

"@typescript-eslint/eslint-plugin@^4.28.4":
version "4.30.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz#4a0c1ae96b953f4e67435e20248d812bfa55e4fb"
Expand Down Expand Up @@ -12954,8 +12949,3 @@ zip-stream@^4.1.0:
archiver-utils "^2.1.0"
compress-commons "^4.1.0"
readable-stream "^3.6.0"

zxcvbn@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/zxcvbn/-/zxcvbn-4.4.2.tgz#28ec17cf09743edcab056ddd8b1b06262cc73c30"
integrity sha1-KOwXzwl0PtyrBW3dixsGJizHPDA=