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

Function readUserEmail

apps/cli/src/device-login.ts:81–87  ·  view source on GitHub ↗
(body: Record<string, unknown>)

Source from the content-addressed store, hash-verified

79
80/** Pull `user.email` out of a token response (WorkOS returns the user inline). */
81const readUserEmail = (body: Record<string, unknown>): string | undefined => {
82 const user = body.user;
83 if (user && typeof user === "object" && "email" in user) {
84 return asString((user as { email?: unknown }).email);
85 }
86 return undefined;
87};
88
89/**
90 * Decode a JWT access token's claims WITHOUT verifying it. The CLI only uses

Callers 1

pollForDeviceTokensFunction · 0.85

Calls 1

asStringFunction · 0.85

Tested by

no test coverage detected