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

Function idTokenIdentityLabel

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

Source from the content-addressed store, hash-verified

528};
529
530export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => {
531 if (!idToken) return undefined;
532 const claims = decodeJwtPayload(idToken);
533 if (!claims) return undefined;
534 return (
535 stringClaim(claims, "email") ??
536 stringClaim(claims, "preferred_username") ??
537 stringClaim(claims, "sub")
538 );
539};
540
541type StrippedTokenResponse = {
542 readonly response: Response;

Callers 2

stripIdTokenFunction · 0.85

Calls 2

decodeJwtPayloadFunction · 0.85
stringClaimFunction · 0.85

Tested by

no test coverage detected