( claims: Readonly<Record<string, unknown>>, key: string, )
| 503 | const decodeJwtClaims = Schema.decodeUnknownOption(Schema.fromJsonString(JwtClaims)); |
| 504 | |
| 505 | const stringClaim = ( |
| 506 | claims: Readonly<Record<string, unknown>>, |
| 507 | key: string, |
| 508 | ): string | undefined => { |
| 509 | const value = claims[key]; |
| 510 | if (typeof value !== "string") return undefined; |
| 511 | const trimmed = value.trim(); |
| 512 | return trimmed.length > 0 ? trimmed : undefined; |
| 513 | }; |
| 514 | |
| 515 | const decodeJwtPayload = (token: string): Readonly<Record<string, unknown>> | null => { |
| 516 | const payload = token.split(".")[1]; |
no outgoing calls
no test coverage detected