feat(auth): implement JWT authentication with secure password hashing

This commit is contained in:
DS | Schubert 2026-07-02 15:43:00 +02:00
parent 6656a8782c
commit 56df3228a4
7 changed files with 146 additions and 74 deletions

View file

@ -2,6 +2,7 @@ from sqlalchemy.orm import Session
from app.models.user import User
from app.schemas.user import UserCreate
from app.core.security import hash_password
class UserRepository:
@ -14,10 +15,10 @@ class UserRepository:
def create(db: Session, user: UserCreate):
db_user = User(
username=user.username,
email=user.email,
password_hash=user.password
)
username=user.username,
email=user.email,
password_hash=hash_password(user.password),
)
db.add(db_user)
db.commit()