Sync fastapi docs from 11614be9 on 2026-03-11

This commit is contained in:
The Librarian
2026-03-11 04:00:06 +00:00
parent 95d1a394e6
commit 18a95756ed
1722 changed files with 91405 additions and 23556 deletions
+5 -2
View File
@@ -48,6 +48,8 @@ class UserInDB(User):
password_hash = PasswordHash.recommended()
DUMMY_HASH = password_hash.hash("dummypassword")
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
app = FastAPI()
@@ -70,6 +72,7 @@ def get_user(db, username: str):
def authenticate_user(fake_db, username: str, password: str):
user = get_user(fake_db, username)
if not user:
verify_password(password, DUMMY_HASH)
return False
if not verify_password(password, user.hashed_password):
return False
@@ -133,10 +136,10 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
@app.get("/users/me/")
async def read_users_me(
current_user: Annotated[User, Depends(get_current_active_user)],
):
) -> User:
return current_user