pvanand commited on
Commit
3ce8c1f
·
verified ·
1 Parent(s): 83ff685

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -16,11 +16,11 @@ logger = logging.getLogger(__name__)
16
  app = FastAPI()
17
 
18
  # API key configuration
19
- API_KEY = os.getenv("API_KEY")
20
  api_key_header = APIKeyHeader(name="X-API-Key", auto_error=False)
21
 
22
  async def verify_api_key(api_key: str = Security(api_key_header)):
23
- if api_key != API_KEY:
24
  logger.warning("Invalid API key used")
25
  raise HTTPException(status_code=403, detail="Could not validate credentials")
26
  return api_key
 
16
  app = FastAPI()
17
 
18
  # API key configuration
19
+ CHAT_AUTH_KEY = os.getenv("CHAT_AUTH_KEY")
20
  api_key_header = APIKeyHeader(name="X-API-Key", auto_error=False)
21
 
22
  async def verify_api_key(api_key: str = Security(api_key_header)):
23
+ if api_key != CHAT_AUTH_KEY:
24
  logger.warning("Invalid API key used")
25
  raise HTTPException(status_code=403, detail="Could not validate credentials")
26
  return api_key