MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / orgIdOf

Function orgIdOf

e2e/cloud/member-seat-billing-sync.test.ts:35–41  ·  view source on GitHub ↗
(bearer: string)

Source from the content-addressed store, hash-verified

33/** The org the bearer is scoped to — the Autumn customer id every billing call
34 * is made against — read from the JWT's public claims. */
35const orgIdOf = (bearer: string): string => {
36 const claims = JSON.parse(Buffer.from(bearer.split(".")[1] ?? "", "base64url").toString()) as {
37 readonly org_id?: string;
38 };
39 if (!claims.org_id) throw new Error("orgIdOf: bearer carries no org_id claim");
40 return claims.org_id;
41};
42
43scenario(
44 "Billing · the billed seat count reaches Autumn: active members only, reconciled not incremented",

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected