Skip to content

Really custom messages are impossible #546

@ivan-kleshnin

Description

@ivan-kleshnin

I want to stick "Passwords don't match" message to verifyPassword field.

First attempt:

verifyPassword: Joi.any().valid(Joi.ref('password')).options({language: {any: {allowOnly: "Passwords don't match"}}}) 

Failed. Result is "verifyPassword Passwords don't match". Joi prefixes message with label and it seems there is no way to turn it off.

Second attempt:

verifyPassword: Joi.any().valid(Joi.ref('password')).options({language: {any: {allowOnly: "Passwords don't match"}}}).label('')

Failed. "smart" check inside Joi prohibits empty labels...

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions