FastAPI - Authentication and Security
Identify the error in this FastAPI security code snippet:
from fastapi import FastAPI, Security
from fastapi.security import APIKeyHeader
app = FastAPI()
api_key_header = APIKeyHeader(name="Authorization")
@app.get("/secure")
async def secure_route(api_key: str = Depends(api_key_header)):
return {"key": api_key}