mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
fix: allow special characters in email (#5327)
Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
committed by
GitHub
parent
edffa5666d
commit
7305713b97
@@ -7,11 +7,10 @@ import useSWR from 'swr'
|
||||
import Link from 'next/link'
|
||||
import Toast from '../components/base/toast'
|
||||
import style from './page.module.css'
|
||||
import { IS_CE_EDITION, SUPPORT_MAIL_LOGIN, apiPrefix } from '@/config'
|
||||
import { IS_CE_EDITION, SUPPORT_MAIL_LOGIN, apiPrefix, emailRegex } from '@/config'
|
||||
import Button from '@/app/components/base/button'
|
||||
import { login, oauth } from '@/service/common'
|
||||
import { getPurifyHref } from '@/utils'
|
||||
const validEmailReg = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$/
|
||||
|
||||
type IState = {
|
||||
formValid: boolean
|
||||
@@ -78,7 +77,7 @@ const NormalForm = () => {
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const handleEmailPasswordLogin = async () => {
|
||||
if (!validEmailReg.test(email)) {
|
||||
if (!emailRegex.test(email)) {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: t('login.error.emailInValid'),
|
||||
|
||||
@@ -102,7 +102,7 @@ export const DEFAULT_PARAGRAPH_VALUE_MAX_LEN = 1000
|
||||
|
||||
export const zhRegex = /^[\u4E00-\u9FA5]$/m
|
||||
export const emojiRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/m
|
||||
export const emailRegex = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$/m
|
||||
export const emailRegex = /^[\w.!#$%&'*+\-/=?^{|}~]+@([\w-]+\.)+[\w-]{2,}$/m
|
||||
const MAX_ZN_VAR_NAME_LENGHT = 8
|
||||
const MAX_EN_VAR_VALUE_LENGHT = 30
|
||||
export const getMaxVarNameLength = (value: string) => {
|
||||
|
||||
Reference in New Issue
Block a user