feat: add admin auth compatibility endpoints
This commit is contained in:
1 parent
20fcf0c3df
commit
0d71b914e4
2 files changed
+23
No files matched your search
@@ -85,6 +85,18 @@ def _require_admin_payload(authorization: str) -> dict:
|
||||
return payload
|
||||
|
||||
|
||||
def get_admin_session(authorization: str = Header(default=None)) -> dict:
|
||||
token = _extract_bearer_token(authorization)
|
||||
payload = _require_admin_payload(authorization)
|
||||
return {
|
||||
"id": "admin",
|
||||
"username": "admin",
|
||||
"token": token,
|
||||
"token_type": "Bearer",
|
||||
"expires_at": payload.get("exp"),
|
||||
}
|
||||
|
||||
|
||||
ADMIN_PUBLIC_ENDPOINTS = {("POST", "/admin/login")}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user