Closed MarcinNiemczyk closed 7 months ago
Add 'Authorize' button to Swagger UI by leveraging built-in FastAPI token interceptors so we can access locked endpoints that require Bearer token. https://fastapi.tiangolo.com/reference/security/#fastapi.security.HTTPBearer
Refactored the verification of JWT Tokens: previously, we injected an unused variable into the controller function; now, we utilize dependencies in the router decorator.
dependencies
Example usage:
@router.get("/all", dependencies=[Depends(verify_jwt)]) def get_all_attractions(db: Session = Depends(get_db)) -> list[AttractionSchema]: return _attraction_service.get_all_attractions(db)
Add 'Authorize' button to Swagger UI by leveraging built-in FastAPI token interceptors so we can access locked endpoints that require Bearer token. https://fastapi.tiangolo.com/reference/security/#fastapi.security.HTTPBearer
Refactored the verification of JWT Tokens: previously, we injected an unused variable into the controller function; now, we utilize
dependencies
in the router decorator.Example usage: