(idToken: string | undefined)
| 589 | }; |
| 590 | |
| 591 | export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => { |
| 592 | if (!idToken) return undefined; |
| 593 | const claims = decodeJwtPayload(idToken); |
| 594 | if (!claims) return undefined; |
| 595 | return ( |
| 596 | stringClaim(claims, "email") ?? |
| 597 | stringClaim(claims, "preferred_username") ?? |
| 598 | stringClaim(claims, "sub") |
| 599 | ); |
| 600 | }; |
| 601 | |
| 602 | type StrippedTokenResponse = { |
| 603 | readonly response: Response; |
no test coverage detected