|
|
@ -509,12 +509,12 @@ def gen_temp_token(email, session):
|
|
|
|
return token
|
|
|
|
return token
|
|
|
|
|
|
|
|
|
|
|
|
def isBadOrPwned(form):
|
|
|
|
def isBadOrPwned(form):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
if len(form.pw.data) < 8:
|
|
|
|
if len(form.pw.data) < 8:
|
|
|
|
return "This password is too short."
|
|
|
|
return "This password is too short."
|
|
|
|
breaches = int(form.pwned.data)
|
|
|
|
breaches = int(form.pwned.data)
|
|
|
|
except ValueError:
|
|
|
|
except ValueError:
|
|
|
|
breaches = -1
|
|
|
|
breaches = -1
|
|
|
|
if breaches > 0:
|
|
|
|
if breaches > 0:
|
|
|
|
return f"This password appears in {breaches} data breaches! It is not unique; please change it."
|
|
|
|
return f"This password appears in {breaches} data breaches! It is not unique; please change it."
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|