Deploy to Staging / deploy (push) Waiting to run
Lint Backend / lint-backend (push) Waiting to run
Playwright Tests / changes (push) Waiting to run
Playwright Tests / test-playwright (1, 4) (push) Blocked by required conditions
Playwright Tests / test-playwright (2, 4) (push) Blocked by required conditions
Playwright Tests / test-playwright (3, 4) (push) Blocked by required conditions
Playwright Tests / test-playwright (4, 4) (push) Blocked by required conditions
Playwright Tests / merge-playwright-reports (push) Blocked by required conditions
Playwright Tests / alls-green-playwright (push) Blocked by required conditions
Test Backend / test-backend (push) Waiting to run
Test Docker Compose / test-docker-compose (push) Waiting to run
13 lines
415 B
Python
13 lines
415 B
Python
from sqlmodel import Session
|
|
|
|
from app.core.security import verify_password
|
|
from app.repositories.user import get_user_by_email
|
|
|
|
|
|
def authenticate(*, session: Session, email: str, password: str) -> User | None:
|
|
db_user = get_user_by_email(session=session, email=email)
|
|
if not db_user:
|
|
return None
|
|
if not verify_password(password, db_user.hashed_password):
|
|
return None
|
|
return db_user |