(idToken: string | undefined)
| 1053 | }; |
| 1054 | |
| 1055 | export 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 | |
| 1066 | type StrippedTokenResponse = { |
| 1067 | readonly response: Response; |
no test coverage detected