|
|
|
@ -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
|
|
|
|
|