(idToken: string | undefined)
| 1033 | }; |
| 1034 | |
| 1035 | export const idTokenIdentityLabel = (idToken: string | undefined): string | undefined => { |
| 1036 | if (!idToken) return undefined; |
| 1037 | const claims = decodeJwtPayload(idToken); |
| 1038 | if (!claims) return undefined; |
| 1039 | return ( |
| 1040 | stringClaim(claims, "email") ?? |
| 1041 | stringClaim(claims, "preferred_username") ?? |
| 1042 | stringClaim(claims, "sub") |
| 1043 | ); |
| 1044 | }; |
| 1045 | |
| 1046 | type StrippedTokenResponse = { |
| 1047 | readonly response: Response; |
no test coverage detected