feat/db-init #3

Open
Nitro wants to merge 41 commits from feat/db-init into dev
Showing only changes of commit 771f7e0549 - Show all commits
+9
View File
1
@@ -114,6 +114,15 @@ class UserRepository:
return User(*row)
return None
def is_valid_authenticate(self, email: str, password_hash: str) -> bool:
with get_connection() as conn:
with conn.cursor() as cur:
cur.execute("""
SELECT 1 FROM users
WHERE email = %s AND password_hash = %s
""", (email, password_hash))
return cur.fetchone() is not None
def user_exists(self, email: str) -> bool:
with get_connection() as conn:
with conn.cursor() as cur: