diff --git a/api/auth.py b/api/auth.py index 2a716e2d..bef3c6ae 100644 --- a/api/auth.py +++ b/api/auth.py @@ -2,6 +2,9 @@ import os from fastapi.security.api_key import APIKeyHeader from fastapi import Security, HTTPException from starlette.status import HTTP_403_FORBIDDEN +from dotenv import load_dotenv + +load_dotenv() apikey=os.getenv('RASPAP_API_KEY') #if env not set, set the api key to "insecure" @@ -17,4 +20,5 @@ async def get_api_key(api_key_header: str = Security(api_key_header)): else: raise HTTPException( status_code=HTTP_403_FORBIDDEN, detail="403: Unauthorized" - ) \ No newline at end of file + ) +