(idToken: string | undefined)
| 528 | }; |
| 529 | |
| 530 | export 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 | |
| 541 | type StrippedTokenResponse = { |
| 542 | readonly response: Response; |
no test coverage detected