diff --git a/database/repositories/user_repository.py b/database/repositories/user_repository.py index d624842..22bb523 100644 --- a/database/repositories/user_repository.py +++ b/database/repositories/user_repository.py @@ -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: