Auth: Fix an oops with headers
I copy pasted the code wrong. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
39ea730be5
commit
2aa9c145be
1 changed files with 2 additions and 2 deletions
4
auth.py
4
auth.py
|
|
@ -55,7 +55,7 @@ def load_auth_keys():
|
|||
|
||||
def check_api_key(x_api_key: str = Header(None), authorization: str = Header(None)):
|
||||
if x_api_key:
|
||||
if auth_keys.verify_key(split_key[1], "api_key"):
|
||||
if auth_keys.verify_key(x_api_key, "api_key"):
|
||||
return x_api_key
|
||||
else:
|
||||
raise HTTPException(401, "Invalid API key")
|
||||
|
|
@ -73,7 +73,7 @@ def check_api_key(x_api_key: str = Header(None), authorization: str = Header(Non
|
|||
|
||||
def check_admin_key(x_admin_key: str = Header(None), authorization: str = Header(None)):
|
||||
if x_admin_key:
|
||||
if auth_keys.verify_key(split_key[1], "api_key"):
|
||||
if auth_keys.verify_key(x_admin_key, "admin_key"):
|
||||
return x_admin_key
|
||||
else:
|
||||
raise HTTPException(401, "Invalid admin key")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue