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

Function idTokenIdentityLabel

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

Source from the content-addressed store, hash-verified

1053};
1054
1055export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => {
1056 if (!idToken) return undefined;
1057 const claims = decodeJwtPayload(idToken);
1058 if (!claims) return undefined;
1059 return (
1060 stringClaim(claims, "email") ??
1061 stringClaim(claims, "preferred_username") ??
1062 stringClaim(claims, "sub")
1063 );
1064};
1065
1066type StrippedTokenResponse = {
1067 readonly response: Response;

Callers 2

stripIdTokenFunction · 0.85

Calls 2

decodeJwtPayloadFunction · 0.85
stringClaimFunction · 0.85

Tested by

no test coverage detected