( claims: Readonly<Record<string, unknown>>, key: string, )
| 564 | const decodeJwtClaims = Schema.decodeUnknownOption(Schema.fromJsonString(JwtClaims)); |
| 565 | |
| 566 | const stringClaim = ( |
| 567 | claims: Readonly<Record<string, unknown>>, |
| 568 | key: string, |
| 569 | ): string | undefined => { |
| 570 | const value = claims[key]; |
| 571 | if (typeof value !== "string") return undefined; |
| 572 | const trimmed = value.trim(); |
| 573 | return trimmed.length > 0 ? trimmed : undefined; |
| 574 | }; |
| 575 | |
| 576 | const decodeJwtPayload = (token: string): Readonly<Record<string, unknown>> | null => { |
| 577 | const payload = token.split(".")[1]; |
no outgoing calls
no test coverage detected