Skip to content

Commit

Permalink
chore: update regex for email
Browse files Browse the repository at this point in the history
  • Loading branch information
Chisomchima committed Dec 12, 2024
1 parent a0913d1 commit 01c8607
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/layout/VerifyEmail.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const sendEmailVerificationMutation = {
type: 'create',
}

const emailRegex =
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i
const emailRegExp =
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/

export function VerifyEmail({ userEmail }) {
const errorAlert = useAlert(({ message }) => message, { critical: true })
Expand All @@ -37,7 +37,7 @@ export function VerifyEmail({ userEmail }) {

const emailConfigured = systemInfo?.emailConfigured

const isValidEmail = emailRegex.test(userEmail)
const isValidEmail = emailRegExp.test(userEmail)

if (!emailConfigured) {
return null
Expand Down

0 comments on commit 01c8607

Please sign in to comment.