Browse Source

📝 Update existing tutorials to use the same new error detail

pull/13786/head
Sebastián Ramírez 8 months ago
parent
commit
f6bf39b592
  1. 2
      docs_src/security/tutorial003.py
  2. 2
      docs_src/security/tutorial003_an.py
  3. 2
      docs_src/security/tutorial003_an_py310.py
  4. 2
      docs_src/security/tutorial003_an_py39.py
  5. 2
      docs_src/security/tutorial003_py310.py

2
docs_src/security/tutorial003.py

@ -60,7 +60,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme)):
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid authentication credentials",
detail="Not authenticated",
headers={"WWW-Authenticate": "Bearer"},
)
return user

2
docs_src/security/tutorial003_an.py

@ -61,7 +61,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid authentication credentials",
detail="Not authenticated",
headers={"WWW-Authenticate": "Bearer"},
)
return user

2
docs_src/security/tutorial003_an_py310.py

@ -60,7 +60,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid authentication credentials",
detail="Not authenticated",
headers={"WWW-Authenticate": "Bearer"},
)
return user

2
docs_src/security/tutorial003_an_py39.py

@ -60,7 +60,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid authentication credentials",
detail="Not authenticated",
headers={"WWW-Authenticate": "Bearer"},
)
return user

2
docs_src/security/tutorial003_py310.py

@ -58,7 +58,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme)):
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid authentication credentials",
detail="Not authenticated",
headers={"WWW-Authenticate": "Bearer"},
)
return user

Loading…
Cancel
Save