BUGFIX: Google OAuth accounts password now cannot be reset

This commit is contained in:
JustIceO7
2025-03-07 02:47:47 +00:00
parent 29f4400e8c
commit cc62cf400f
3 changed files with 16 additions and 3 deletions

View File

@@ -196,10 +196,12 @@ def user_forgot_password(email):
Initializes the function to handle password reset
"""
exists = email_exists(email)
if(exists):
password = has_password(email)
# Checks if password exists and is not a Google OAuth account
if(exists and password):
send_email(email, lambda: forgot_password_body(email))
return email
return jsonify({"error":"email not found"}), 404
return jsonify({"error":"Invalid email or not found"}), 404
@user_bp.route("/send_newsletter/<string:email>", methods=["POST"])
def send_newsletter(email):