File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -240,16 +240,17 @@ async def authenticate(
240
240
return True
241
241
242
242
# check bearer credentials against the api_key
243
- if authorization : # and authorization.credentials == settings.api_key:
244
- goodkey ,message = check_and_update_api_key (api_key = authorization .credentials ,invocation_type = "text" )
245
- if goodkey :
243
+ if authorization and authorization .credentials == settings .api_key :
244
+ # goodkey,message=check_and_update_api_key(api_key=authorization.credentials,invocation_type="text")
245
+ # if goodkey:
246
246
# api key is valid
247
- return authorization .credentials
248
- else :
249
- raise HTTPException (
250
- status_code = status .HTTP_401_UNAUTHORIZED ,
251
- detail = message ,
252
- )
247
+ # return authorization.credentials
248
+ #else:
249
+ # raise HTTPException(
250
+ # status_code=status.HTTP_401_UNAUTHORIZED,
251
+ # detail=message,
252
+ # )
253
+ return authorization .credentials
253
254
254
255
# raise http error 401
255
256
raise HTTPException (
You can’t perform that action at this time.
0 commit comments