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

Function idTokenIdentityLabel

packages/core/sdk/src/oauth-helpers.ts:613–622  ·  view source on GitHub ↗
(idToken: string | undefined)

Source from the content-addressed store, hash-verified

611};
612
613export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => {
614 if (!idToken) return undefined;
615 const claims = decodeJwtPayload(idToken);
616 if (!claims) return undefined;
617 return (
618 stringClaim(claims, "email") ??
619 stringClaim(claims, "preferred_username") ??
620 stringClaim(claims, "sub")
621 );
622};
623
624type StrippedTokenResponse = {
625 readonly response: Response;

Callers 2

stripIdTokenFunction · 0.85

Calls 2

decodeJwtPayloadFunction · 0.85
stringClaimFunction · 0.85

Tested by

no test coverage detected