MCPcopy Index your code
hub / github.com/fastapi/fastapi / authenticate_user

Function authenticate_user

docs_src/security/tutorial004_py310.py:71–78  ·  view source on GitHub ↗
(fake_db, username: str, password: str)

Source from the content-addressed store, hash-verified

69
70
71def authenticate_user(fake_db, username: str, password: str):
72 user = get_user(fake_db, username)
73 if not user:
74 verify_password(password, DUMMY_HASH)
75 return False
76 if not verify_password(password, user.hashed_password):
77 return False
78 return user
79
80
81def create_access_token(data: dict, expires_delta: timedelta | None = None):

Callers 1

login_for_access_tokenFunction · 0.70

Calls 2

get_userFunction · 0.70
verify_passwordFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…