Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com>
else:
return None
if scheme.lower() != "digest":
- raise HTTPException(
- status_code=HTTP_403_FORBIDDEN,
- detail="Invalid authentication credentials",
- )
+ if self.auto_error:
+ raise HTTPException(
+ status_code=HTTP_403_FORBIDDEN,
+ detail="Invalid authentication credentials",
+ )
+ else:
+ return None
return HTTPAuthorizationCredentials(scheme=scheme, credentials=credentials)
response = client.get(
"/users/me", headers={"Authorization": "Other invalidauthorization"}
)
- assert response.status_code == 403, response.text
- assert response.json() == {"detail": "Invalid authentication credentials"}
+ assert response.status_code == 200, response.text
+ assert response.json() == {"msg": "Create an account first"}
def test_openapi_schema():