(idToken: string | undefined)
| 611 | }; |
| 612 | |
| 613 | export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => { |
| 614 | if (!idToken) return undefined; |
| 615 | const claims = decodeJwtPayload(idToken); |
| 616 | if (!claims) return undefined; |
| 617 | return ( |
| 618 | stringClaim(claims, "email") ?? |
| 619 | stringClaim(claims, "preferred_username") ?? |
| 620 | stringClaim(claims, "sub") |
| 621 | ); |
| 622 | }; |
| 623 | |
| 624 | type StrippedTokenResponse = { |
| 625 | readonly response: Response; |
no test coverage detected