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

Function idTokenIdentityLabel

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

Source from the content-addressed store, hash-verified

1033};
1034
1035export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => {
1036 if (!idToken) return undefined;
1037 const claims = decodeJwtPayload(idToken);
1038 if (!claims) return undefined;
1039 return (
1040 stringClaim(claims, "email") ??
1041 stringClaim(claims, "preferred_username") ??
1042 stringClaim(claims, "sub")
1043 );
1044};
1045
1046type StrippedTokenResponse = {
1047 readonly response: Response;

Callers 2

stripIdTokenFunction · 0.85

Calls 2

decodeJwtPayloadFunction · 0.85
stringClaimFunction · 0.85

Tested by

no test coverage detected