Skip to content

Commit

Permalink
tweak: dont validate password length on unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
annybs committed Jan 21, 2022
1 parent d7822e2 commit bac6003
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/index/UnlockModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default {
validations() {
return {
password: [
...validation.password,
validation.passwordRequired,
helpers.withAsync(helpers.withMessage('Incorrect password.', this.checkPassword))
]
}
Expand Down
7 changes: 6 additions & 1 deletion src/utils/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,16 @@ const ethAddressRegexp = /^0x[a-fA-F0-9]{40}$/
*/
export const ethAddress = helpers.withMessage('Invalid Ethereum address.', v => ethAddressRegexp.test(v))

/**
* Required password validator,
*/
export const passwordRequired = helpers.withMessage('Password required.', _required)

/**
* Password validation rules.
*/
export const password = [
helpers.withMessage('Password required.', _required),
passwordRequired,
helpers.withMessage('Must be 10 characters or more.', minLength(10)),
]

Expand Down

0 comments on commit bac6003

Please sign in to comment.