(idToken: string | undefined)
| 491 | }; |
| 492 | |
| 493 | export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => { |
| 494 | if (!idToken) return undefined; |
| 495 | const claims = decodeJwtPayload(idToken); |
| 496 | if (!claims) return undefined; |
| 497 | return ( |
| 498 | stringClaim(claims, "email") ?? |
| 499 | stringClaim(claims, "preferred_username") ?? |
| 500 | stringClaim(claims, "sub") |
| 501 | ); |
| 502 | }; |
| 503 | |
| 504 | type StrippedTokenResponse = { |
| 505 | readonly response: Response; |
no test coverage detected