Table of Contents |
---|
Purpose
...
- has at least 12 characters long;
- contains both upper- and lowercase letters, numbers, and letter and numbers (required), special characters (optional)
Must be controlled by regular expression: ^(?=.*?[a-zаz][а-яёїієґ])(?=.*?[A-ZА-ЯЁЇIЄҐ])(?=.*?[0-9])(?=.*?[^a-zA-Z]).{8,}\d)
- Validate upper, lowercase letter and numbers
In case of error - return 422 error (message: "Password doest does not meet complexity requirements")
Code Block | ||
---|---|---|
| ||
{:error, [{%{ description: "Password doestdoes not meet complexity requirements", params: [], rule: :invalid }, "$.password"}]} |
- 2. Validate password length (at least 12 characters long)
In case of error - return 422 error (message: "Password must be at least 12 characters long")
Code Block | ||
---|---|---|
| ||
{:error, [{%{
description: "Password must be at least 12 characters long",
params: [],
rule: :invalid
}, "$.password"}]} |
...
Destination | Source | Description |
---|---|---|
id | Autogenerated | |
user_id | $.user_id | Extract user from token |
password | $.decrypted_hash | |
inserted_at | Timestamp: now() | Get current date-time |
3. Not allow to use recently used passwords
...