forked from open-webui/open-webui
feat/fix: email format validation
This commit is contained in:
parent
cbee5621c3
commit
d8754b4486
3 changed files with 39 additions and 25 deletions
|
@ -1,4 +1,5 @@
|
|||
import hashlib
|
||||
import re
|
||||
|
||||
|
||||
def get_gravatar_url(email):
|
||||
|
@ -21,3 +22,9 @@ def calculate_sha256(file):
|
|||
for chunk in iter(lambda: file.read(8192), b""):
|
||||
sha256.update(chunk)
|
||||
return sha256.hexdigest()
|
||||
|
||||
|
||||
def validate_email_format(email: str) -> bool:
|
||||
if not re.match(r"[^@]+@[^@]+\.[^@]+", email):
|
||||
return False
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue