feat: add database & auth manager classes

This commit is contained in:
2026-02-23 22:27:15 +00:00
parent 66f1b26cc8
commit 96a5bcc9e8
2 changed files with 48 additions and 0 deletions

12
server/auth.py Normal file
View File

@@ -0,0 +1,12 @@
from db.database import PostgresConnector
class AuthManager:
def __init__(self, db: PostgresConnector, bcrypt):
self.db = db
self.bcrypt = bcrypt
def register_user(self, username, password):
# Hash the password
hashed_password = self.bcrypt.generate_password_hash(password).decode("utf-8")
# Save the user to the database
self.db.save_user(username, hashed_password)