MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / delete_token

Function delete_token

src/api/admin.py:974–985  ·  view source on GitHub ↗

Delete token

(
    token_id: int,
    token: str = Depends(verify_admin_token)
)

Source from the content-addressed store, hash-verified

972async def admin_logout(response: Response, token: str = Depends(verify_admin_token)):
973 """Admin logout - invalidate session token"""
974 active_admin_tokens.discard(token)
975 response.delete_cookie(ADMIN_SESSION_COOKIE_NAME, path="/")
976 return {"success": True, "message": "退出登录成功"}
977
978
979@router.post("/api/admin/change-password")
980async def change_password(
981 request: ChangePasswordRequest, token: str = Depends(verify_admin_token)
982):
983 """Change admin password"""
984 admin_config = await db.get_admin_config()
985
986 # Verify old password
987 if not AuthManager.verify_admin(admin_config.username, request.old_password):
988 raise HTTPException(status_code=400, detail="旧密码错误")

Callers

nothing calls this directly

Calls 2

remove_tokenMethod · 0.80
delete_tokenMethod · 0.45

Tested by

no test coverage detected