( claims: Readonly<Record<string, unknown>>, key: string, )
| 466 | const decodeJwtClaims = Schema.decodeUnknownOption(Schema.fromJsonString(JwtClaims)); |
| 467 | |
| 468 | const stringClaim = ( |
| 469 | claims: Readonly<Record<string, unknown>>, |
| 470 | key: string, |
| 471 | ): string | undefined => { |
| 472 | const value = claims[key]; |
| 473 | if (typeof value !== "string") return undefined; |
| 474 | const trimmed = value.trim(); |
| 475 | return trimmed.length > 0 ? trimmed : undefined; |
| 476 | }; |
| 477 | |
| 478 | const decodeJwtPayload = (token: string): Readonly<Record<string, unknown>> | null => { |
| 479 | const payload = token.split(".")[1]; |
no outgoing calls
no test coverage detected