Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email validations rejects valid email addresses #33

Closed
siddharth-lakhara opened this issue Jan 8, 2021 · 0 comments
Closed

Email validations rejects valid email addresses #33

siddharth-lakhara opened this issue Jan 8, 2021 · 0 comments
Assignees
Labels
bug Bug or defect
Milestone

Comments

@siddharth-lakhara
Copy link

Support plan

  • is this issue currently blocking your project? (yes/no): yes
  • is this issue affecting a production system? (yes/no): yes

Context

  • node version: 10.22.1
  • module version with issue: 17.3.0
  • last module version without issue: NA
  • environment (e.g. node, browser, native): NodeJs
  • used with (e.g. hapi application, another framework, standalone, ...): ExpressJs
  • any other relevant information:

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

We are trying to verify emails using Joi. Following snippet demonstrates the way we are using Joi. The variable failingPayload contains the email address which Joi rejects. The email domain "dpllp.cpa" is valid

const joiSchema = Joi.object({
    emailAddress: Joi.string().email().required(),
  });
const failingPayload = {
  emailAdress: "username@dpllp.cpa"
};
Joi.assert(failingPayload, joiSchema)

What was the result you got?

We got validation error stating that the email address is invalid.

What result did you expect?

Since this email is valid. We expect Joi to pass this validation.

Additional Information

Looking at the API docs (here), we figured out that this validation uses IANA TLD list. However, the TLD CPA is present in (IANA TLD Directory)

@hueniverse hueniverse transferred this issue from hapijs/joi Feb 8, 2021
@hueniverse hueniverse added this to the 4.1.1 milestone Feb 8, 2021
@hueniverse hueniverse added the bug Bug or defect label Feb 8, 2021
@hueniverse hueniverse self-assigned this Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants