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: email validate regex #10912

Merged
merged 1 commit into from
Oct 8, 2023
Merged

fix: email validate regex #10912

merged 1 commit into from
Oct 8, 2023

Conversation

nuanyang233
Copy link
Collaborator

Description

Closes # MF-5440 MF-5441 MF-5442

Type of change

  • Documentation
  • Code refactoring (Restructuring existing code w/o changing its observable behavior)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (a fix or feature that would make something no longer possible to do/require old user must upgrade their Mask Network to this new version)

Previews

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
    • I have removed all in development console.logs
    • I have removed all commented code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have read Internationalization Guide and moved text fields to the i18n JSON file.

If this PR depends on external APIs:

  • I have configured those APIs with CORS headers to let extension requests get passed.
    • chrome extension: chrome-extension://[id]
    • firefox extension: moz-extension://[id]
  • I have delegated all web requests to the background service via the internal RPC bridge.

@nuanyang233 nuanyang233 added this to the 2.23.0 milestone Oct 8, 2023
@guanbinrui guanbinrui merged commit bdd98c2 into release/2.23.0 Oct 8, 2023
14 checks passed
@guanbinrui guanbinrui deleted the fix/email-validation branch October 8, 2023 07:04
guanbinrui pushed a commit that referenced this pull request Oct 8, 2023
@@ -1,5 +1,5 @@
export const passwordRegexp = /^(?=.{8,20}$)(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[^\dA-Za-z]).*/

export const emailRegexp = /^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/
export const emailRegexp = /^([\w!#$%&*+./=?^`{|}~’-]{1,64}@([\dA-Za-z-]{1,255}.[\dA-Za-z-]{2,}))$/
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Actually, I would suggest using browser's input type=email to validate it, even if your RegEx looks right even for some extreme cases

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to validate the email to display the helper text.

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.

None yet

3 participants