Skip to content

Joi.ref doesnt works on password_confirmation #47

@animalinstinct

Description

@animalinstinct

Hi
"joi-browser": "^13.4.0",
"react": "^16.12.0",

trying to add validation to my registration form, got a problem with password confirmation. Valid and joi.ref doesnt works. I have tried different combinations from many different manuals, but no luck, it doesnt works.

password: Joi.string()
.required()
.min(8)
.label("Password"),
password_confirmation: Joi.any()
.required()
.valid(Joi.ref("password"))
.options({
language: {
any: {
allowOnly: "!!Passwords do not match"
}
}
})

I have checked via state, inputs are equal, but validator still count it as unequal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions