exvalidate v0.0.2 Exvalidate.Rules.Password View Source

We can validate password in two ways:

1- Our regex that validate: 1 digit, 1 mayus, 1 minus, 1 special character, between 8 and 32. 2- Developer Regex.

Examples

iex(3)> Exvalidate.Rules.Password.validating(:password, "This_4_p2ssw0rd")
{:ok, "This_4_p2ssw0rd"}
iex(3)> Exvalidate.Rules.Password.validating(:password, "thisApassword")
{:error, :bad_password}
iex(3)> Exvalidate.Rules.Password.validating(:password, 1)
{:error, :bad_password}

For see examples go to the tests: test/rules/password_test.exs