INNER CODE UNIT · Python
__call__
tokusumi/fastapi-cloudauth · fastapi_cloudauth/base.py:55
async def __call__(
self,
http_auth: Optional[HTTPAuthorizationCredentials] = Depends(
HTTPBearer(auto_error=False)
),
) -> Any:
"""User access/ID-token verification Shortcut to pass it into dependencies.
Use as (where `auth` is this instance and `app` is fastapi.FastAPI instance):
```
from fastapi import Depends
@app.get("/", dependencies=[Depends(auth)])
def api():
return "hello"
```
"""
if http_auth is None:
if self.verifier.auto_error: