diff --git a/api/chalicelib/core/reset_password.py b/api/chalicelib/core/reset_password.py index 0b7302d5d..e4ee1b61d 100644 --- a/api/chalicelib/core/reset_password.py +++ b/api/chalicelib/core/reset_password.py @@ -1,5 +1,5 @@ -from chalicelib.utils import email_helper, captcha, helper from chalicelib.core import users +from chalicelib.utils import email_helper, captcha, helper def reset(data): @@ -10,7 +10,8 @@ def reset(data): return {"errors": ["Invalid captcha."]} if "email" not in data: return {"errors": ["email not found in body"]} - + if not helper.has_smtp(): + return {"errors": ["no SMTP configuration found"]} a_users = users.get_by_email_only(data["email"]) if len(a_users) > 1: print(f"multiple users found for [{data['email']}] please contact our support") diff --git a/ee/api/chalicelib/core/reset_password.py b/ee/api/chalicelib/core/reset_password.py index c1ac1fe65..fe8cdd15c 100644 --- a/ee/api/chalicelib/core/reset_password.py +++ b/ee/api/chalicelib/core/reset_password.py @@ -10,7 +10,8 @@ def reset(data): return {"errors": ["Invalid captcha."]} if "email" not in data: return {"errors": ["email not found in body"]} - + if not helper.has_smtp(): + return {"errors": ["no SMTP configuration found"]} a_user = users.get_by_email_only(data["email"]) if a_user is not None: # ---FOR SSO