Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
17a81181
Unverified
Commit
17a81181
authored
May 22, 2023
by
Joel
Committed by
GitHub
May 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: email reg (#135)
parent
4db01403
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
helper.py
api/libs/helper.py
+1
-1
installForm.tsx
web/app/install/installForm.tsx
+1
-1
normalForm.tsx
web/app/signin/normalForm.tsx
+1
-1
index.ts
web/config/index.ts
+3
-3
No files found.
api/libs/helper.py
View file @
17a81181
...
@@ -21,7 +21,7 @@ class TimestampField(fields.Raw):
...
@@ -21,7 +21,7 @@ class TimestampField(fields.Raw):
def
email
(
email
):
def
email
(
email
):
# Define a regex pattern for email addresses
# Define a regex pattern for email addresses
pattern
=
r"^[\w\.-]+@([\w-]+\.)+[\w-]{2,
4
}$"
pattern
=
r"^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$"
# Check if the email matches the pattern
# Check if the email matches the pattern
if
re
.
match
(
pattern
,
email
)
is
not
None
:
if
re
.
match
(
pattern
,
email
)
is
not
None
:
return
email
return
email
...
...
web/app/install/installForm.tsx
View file @
17a81181
...
@@ -7,7 +7,7 @@ import { useRouter } from 'next/navigation'
...
@@ -7,7 +7,7 @@ import { useRouter } from 'next/navigation'
import
Toast
from
'../components/base/toast'
import
Toast
from
'../components/base/toast'
import
{
setup
}
from
'@/service/common'
import
{
setup
}
from
'@/service/common'
const
validEmailReg
=
/^
[\w\.
-
]
+@
([\w
-
]
+
\.)
+
[\w
-
]{2,
4
}
$/
const
validEmailReg
=
/^
[\w\.
-
]
+@
([\w
-
]
+
\.)
+
[\w
-
]{2,}
$/
const
validPassword
=
/^
(?=
.*
[
a-zA-Z
])(?=
.*
\d)
.
{8,}
$/
const
validPassword
=
/^
(?=
.*
[
a-zA-Z
])(?=
.*
\d)
.
{8,}
$/
const
InstallForm
=
()
=>
{
const
InstallForm
=
()
=>
{
...
...
web/app/signin/normalForm.tsx
View file @
17a81181
...
@@ -13,7 +13,7 @@ import Button from '@/app/components/base/button'
...
@@ -13,7 +13,7 @@ import Button from '@/app/components/base/button'
import
{
login
,
oauth
}
from
'@/service/common'
import
{
login
,
oauth
}
from
'@/service/common'
import
{
apiPrefix
}
from
'@/config'
import
{
apiPrefix
}
from
'@/config'
const
validEmailReg
=
/^
[\w\.
-
]
+@
([\w
-
]
+
\.)
+
[\w
-
]{2,
4
}
$/
const
validEmailReg
=
/^
[\w\.
-
]
+@
([\w
-
]
+
\.)
+
[\w
-
]{2,}
$/
type
IState
=
{
type
IState
=
{
formValid
:
boolean
formValid
:
boolean
...
...
web/config/index.ts
View file @
17a81181
...
@@ -75,9 +75,9 @@ export const LOCALE_COOKIE_NAME = 'locale'
...
@@ -75,9 +75,9 @@ export const LOCALE_COOKIE_NAME = 'locale'
export
const
DEFAULT_VALUE_MAX_LEN
=
48
export
const
DEFAULT_VALUE_MAX_LEN
=
48
export
const
zhRegex
=
/^
[\u
4e00-
\u
9fa5
]
$/
g
m
export
const
zhRegex
=
/^
[\u
4e00-
\u
9fa5
]
$/m
export
const
emojiRegex
=
/^
[\u
D800-
\u
DBFF
][\u
DC00-
\u
DFFF
]
$/
g
m
export
const
emojiRegex
=
/^
[\u
D800-
\u
DBFF
][\u
DC00-
\u
DFFF
]
$/m
export
const
emailRegex
=
/^
[\w\.
-
]
+@
([\w
-
]
+
\.)
+
[\w
-
]{2,
4}
$/g
m
export
const
emailRegex
=
/^
[\w\.
-
]
+@
([\w
-
]
+
\.)
+
[\w
-
]{2,
}
$/
m
const
MAX_ZN_VAR_NAME_LENGHT
=
8
const
MAX_ZN_VAR_NAME_LENGHT
=
8
const
MAX_EN_VAR_VALUE_LENGHT
=
16
const
MAX_EN_VAR_VALUE_LENGHT
=
16
export
const
getMaxVarNameLength
=
(
value
:
string
)
=>
{
export
const
getMaxVarNameLength
=
(
value
:
string
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment