From ba6b0b851f545f3fc1361abc121b0a0066a367ca Mon Sep 17 00:00:00 2001 From: Tracker-Friendly Date: Mon, 20 Nov 2023 00:51:01 +0000 Subject: [PATCH] Updated login --- account/account.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/account/account.py b/account/account.py index d74c274..021223c 100644 --- a/account/account.py +++ b/account/account.py @@ -65,7 +65,19 @@ def delete(): if passwordhash: if verify_hash == passwordhash: - return "Your account would have been deleted... if this worked. Which it doesn't. Email postmaster@hectabit.org to delete your email." + # return "Your account would have been deleted... if this worked. Which it doesn't. Email postmaster@hectabit.org to delete your email." + cmd = ["maddy", "creds", "delete", key_to_fetch] + result = subprocess.run(" ".join(cmd), shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + if result.returncode == 0: + # Command executed successfully + return "Email deleted!" + else: + # Handle errors, log them, and return False + error_message = result.stderr.decode("utf-8") + print(f"Error deleting email account: {error_message}") + return "Error deleting email account!" + else: return "Incorrect email or password" else: