Skip to content

Commit

Permalink
fix: bearer api key authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
okradze committed Dec 14, 2023
1 parent ece5489 commit 71251db
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/server/utils/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ def authenticate_by_api_key(
request: Request, response: Response
) -> Tuple[UserOutput, AccountOutput]:
authorization = request.headers.get("Authorization", None)
_, token = get_authorization_scheme_param(authorization)

api_key_model = ApiKeyModel.get_api_key_by_token(db.session, token)
api_key_model = ApiKeyModel.get_api_key_by_token(db.session, authorization)

if not api_key_model:
raise HTTPException(status_code=401, detail="Invalid API key")
Expand Down

0 comments on commit 71251db

Please sign in to comment.