MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / login

Function login

apps/admin/views.py:52–57  ·  view source on GitHub ↗
(data: LoginData)

Source from the content-addressed store, hash-verified

50
51@admin_api.post("/login")
52async def login(data: LoginData):
53 if not verify_password(data.password, settings.admin_token):
54 raise HTTPException(status_code=401, detail="密码错误")
55
56 token = create_token({"is_admin": True})
57 return APIResponse(detail={"token": token, "token_type": "Bearer"})
58
59
60@admin_api.get("/verify")

Callers

nothing calls this directly

Calls 3

verify_passwordFunction · 0.90
create_tokenFunction · 0.90
APIResponseClass · 0.90

Tested by

no test coverage detected