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

Function idTokenIdentityLabel

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

Source from the content-addressed store, hash-verified

491};
492
493export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => {
494 if (!idToken) return undefined;
495 const claims = decodeJwtPayload(idToken);
496 if (!claims) return undefined;
497 return (
498 stringClaim(claims, "email") ??
499 stringClaim(claims, "preferred_username") ??
500 stringClaim(claims, "sub")
501 );
502};
503
504type StrippedTokenResponse = {
505 readonly response: Response;

Callers 2

stripIdTokenFunction · 0.85

Calls 2

decodeJwtPayloadFunction · 0.85
stringClaimFunction · 0.85

Tested by

no test coverage detected