From 6c4d9f04451f344d16506c3cda2db71c8df7eb8a Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Sun, 9 Feb 2025 18:19:36 +0700 Subject: [PATCH] Fixing false field name on SQL query --- modules/api/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/api/auth.py b/modules/api/auth.py index 706752b..8ada0ea 100644 --- a/modules/api/auth.py +++ b/modules/api/auth.py @@ -146,7 +146,7 @@ class auth: payload = tokenguard.decode(token_encrypt, globalvar.ssh['key']['public']) token = payload['token'] loggorilla.prcss(APIADDR, "Get dependency data") - self.cursor.execute(f"SELECT COUNT(*) AS `count`, auth_profile_verification.verified FROM auth_profile_verification INNER JOIN auth_profile ON auth_profile.id = auth_profile_verification.auth_profile WHERE auth_profile.token = %s AND auth_profile_verification.type = 'email' ; ", (token,) ) + self.cursor.execute(f"SELECT COUNT(*) AS `count`, auth_profile_verification.verified FROM auth_profile_verification INNER JOIN auth_profile ON auth_profile.id = auth_profile_verification.profile WHERE auth_profile.token = %s AND auth_profile_verification.type = 'email' ; ", (token,) ) result_verification = self.cursor.fetchone() self.cursor.execute("SELECT COUNT(*) AS `count`, token, id, email FROM auth_profile WHERE token = %s ; ", (token,) ) result_profile = self.cursor.fetchone() @@ -191,7 +191,7 @@ class auth: token = payload['token'] expired = datetime.datetime.fromisoformat(payload['expired']) loggorilla.prcss(APIADDR, "Get dependency data") - self.cursor.execute(f"SELECT COUNT(*) AS `count`, auth_profile_verification.verified FROM auth_profile_verification INNER JOIN auth_profile ON auth_profile.id = auth_profile_verification.auth_profile WHERE auth_profile.token = %s AND auth_profile_verification.type = 'email' ; ", (token,) ) + self.cursor.execute(f"SELECT COUNT(*) AS `count`, auth_profile_verification.verified FROM auth_profile_verification INNER JOIN auth_profile ON auth_profile.id = auth_profile_verification.profile WHERE auth_profile.token = %s AND auth_profile_verification.type = 'email' ; ", (token,) ) result_verification = self.cursor.fetchone() self.cursor.execute("SELECT COUNT(*) AS `count`, token, username, id, email FROM auth_profile WHERE token = %s ; ", (token,) ) result_profile = self.cursor.fetchone() @@ -208,7 +208,7 @@ class auth: response["desc" ] = "Expired. Your data removed." else: loggorilla.prcss(APIADDR, "Updating") - self.cursor.execute("UPDATE `auth_profile_verification` SET `verified` = 1 WHERE `type` = 'email' AND `auth_profile` = %s ; ", (result_profile['id'],) ) + self.cursor.execute("UPDATE `auth_profile_verification` SET `verified` = 1 WHERE `type` = 'email' AND `profile` = %s ; ", (result_profile['id'],) ) loggorilla.prcss(APIADDR, "Sending email") webmail_data = { "username" : result_profile['username' ],