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

fix: #3271 email validation #3273

Open
wants to merge 8 commits into
base: beta
Choose a base branch
from

Conversation

Idrinth
Copy link
Sponsor Contributor

@Idrinth Idrinth commented Apr 27, 2024

Description

This PR fixes the email validation

Related Tickets & Documents

Fixes #3271

Mobile & Desktop Screenshots/Recordings

N/A

Steps to QA

This cleans up some code and adds regression tests, so running npm test is sufficient.

Tier (staff will fill in)

  • Tier 1
  • Tier 2
  • Tier 3
  • Tier 4

[optional] Are there any post-deployment tasks we need to perform?

None I know of.

[optional] What gif best describes this PR or how it makes you feel?

image

Copy link

netlify bot commented Apr 27, 2024

Deploy Preview for oss-insights ready!

Name Link
🔨 Latest commit f0354af
🔍 Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/664acf6f1adc340008d18235
😎 Deploy Preview https://deploy-preview-3273--oss-insights.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Compliance Checks Passed!

Copy link

netlify bot commented Apr 27, 2024

Deploy Preview for design-insights ready!

Name Link
🔨 Latest commit f0354af
🔍 Latest deploy log https://app.netlify.com/sites/design-insights/deploys/664acf6f99c6d50008283d44
😎 Deploy Preview https://deploy-preview-3273--design-insights.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Idrinth Idrinth changed the title Idrinth/issue 3271 email validation fix: #3271 email validation Apr 27, 2024
);
};
const emailRegexp =
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-z\-0-9]+\.)+[a-z]{2,}))$/i;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which regex is this? On the backend API, we use the HTML 5 email validator from the web standard spec:

https://github.com/open-sauced/api/blob/9996046f4c21789c40d54d30d9b6b5a4ed4d02cb/src/common/util/email.ts#L3-L17

It looks like this drifts abit. And I'd prefer if we aligned these.

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this is the same one as before, I just extracted it to prevent it from being rebuilt . Will update it to the one from the backend.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, sounds great 👍

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found the failure issue as well, the new regexp allows top level domains for emails, so adjusted the test to match that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: email address is considered invalid
3 participants