INNER CODE UNIT · Python
__call__
tokusumi/fastapi-cloudauth · fastapi_cloudauth/auth0.py:96
def __call__(self, claims: Dict[str, str], auto_error: bool = True) -> bool:
# TODO: check the aud more
# check the nonce
try:
nonce = claims["nonce"]
if nonce != self._nonce:
if auto_error:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=NOT_VERIFIED
)
return False
except KeyError:
pass
return True