Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Improve validation messages #134

Open
stpoa opened this issue May 22, 2019 · 0 comments
Open

Improve validation messages #134

stpoa opened this issue May 22, 2019 · 0 comments

Comments

@stpoa
Copy link
Owner

stpoa commented May 22, 2019

Improve validation messages, example:

export const passwordValidator: Validator = value => {
  const passwordRegex = /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\w\s])/
  const trimmedValue = value.trim()

  return passwordLengthValidator(trimmedValue) ||
    !passwordRegex.test(trimmedValue)
    ? 'Nieprawidłowe hasło!'
    : ''
}

It should inform person about length, small big letters, special characters etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant