mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-12 10:45:38 +02:00
doh2
This commit is contained in:
parent
6b7026ef69
commit
001acd60ac
@ -509,12 +509,12 @@ def gen_temp_token(email, session):
|
||||
return token
|
||||
|
||||
def isBadOrPwned(form):
|
||||
try:
|
||||
if len(form.pw.data) < 8:
|
||||
return "This password is too short."
|
||||
breaches = int(form.pwned.data)
|
||||
except ValueError:
|
||||
breaches = -1
|
||||
if breaches > 0:
|
||||
return f"This password appears in {breaches} data breaches! It is not unique; please change it."
|
||||
try:
|
||||
if len(form.pw.data) < 8:
|
||||
return "This password is too short."
|
||||
breaches = int(form.pwned.data)
|
||||
except ValueError:
|
||||
breaches = -1
|
||||
if breaches > 0:
|
||||
return f"This password appears in {breaches} data breaches! It is not unique; please change it."
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user