Skip to content

Valid emails are considered invalid #2113

@vadzappa

Description

@vadzappa

Context

  • node version: any
  • joi version: 15.1.1
  • environment (node, browser): any
  • used with (hapi, standalone, ...): hapi
  • any other relevant information:

What are you trying to achieve or the steps to reproduce ?

Trying to validate email printifyapp.com_00000000000000000000000000000000000000000000000000@resource.calendar.google.com using Joi standard .email() and it reports that Email is not valid, while it looks legit and is produced by https://printify.com/.

const schema = Joi.object({
			email: Joi.string().trim().email({tlds: false}).required(),
		});
const { error } = Joi.validate({
	email: 'printifyapp.com_00000000000000000000000000000000000000000000000000@resource.calendar.google.com',
}, schema);

assert.ok(!error, error);

Which result you had ?

ValidationError: child "email" fails because ["email" must be a valid email]

What did you expect ?

No validation errors

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions