v1.0
This commit is contained in:
3
main.py
3
main.py
@@ -6,6 +6,7 @@ from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
|
||||
from starlette import status
|
||||
from starlette.responses import JSONResponse
|
||||
|
||||
import backend.config
|
||||
import background.tasks
|
||||
from background.tasks import *
|
||||
from schemas.general import UpdateRequest, UpdateResponse, UpdateMarketplaceRequest, UpdateMarketplacesRequest
|
||||
@@ -14,7 +15,7 @@ auth_schema = HTTPBearer()
|
||||
|
||||
|
||||
async def check_auth(token: Annotated[HTTPAuthorizationCredentials, Depends(auth_schema)]):
|
||||
if token.credentials != 'vvHh1QNl7lS6c7OVwmxU1TVNd7DLlc9W810csZGf4rkqOrBy6fQwlhIDZsQZd9hQYZYK47yWv33aCq':
|
||||
if token.credentials != backend.config.API_KEY:
|
||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail='Invalid credentials')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user