MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / authenticate

Function authenticate

backend/src/auth/services.py:50–58  ·  view source on GitHub ↗
(*, session: Session, email: str, password: str)

Source from the content-addressed store, hash-verified

48
49
50def authenticate(*, session: Session, email: str, password: str) -> User | None:
51 from src.users.services import get_user_by_email
52
53 db_user = get_user_by_email(session=session, email=email)
54 if not db_user:
55 return None
56 if not verify_password(password, db_user.hashed_password):
57 return None
58 return db_user
59
60
61def create_access_token(subject: str | Any, expires_delta: timedelta) -> str:

Callers 2

test_authenticate_userFunction · 0.90

Calls 2

get_user_by_emailFunction · 0.90
verify_passwordFunction · 0.85

Tested by 2

test_authenticate_userFunction · 0.72