mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-25 08:48:57 +00:00
Auth: Fix an oops with headers
I copy pasted the code wrong. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
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)):
|
def check_api_key(x_api_key: str = Header(None), authorization: str = Header(None)):
|
||||||
if x_api_key:
|
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
|
return x_api_key
|
||||||
else:
|
else:
|
||||||
raise HTTPException(401, "Invalid API key")
|
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)):
|
def check_admin_key(x_admin_key: str = Header(None), authorization: str = Header(None)):
|
||||||
if x_admin_key:
|
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
|
return x_admin_key
|
||||||
else:
|
else:
|
||||||
raise HTTPException(401, "Invalid admin key")
|
raise HTTPException(401, "Invalid admin key")
|
||||||
|
|||||||
Reference in New Issue
Block a user