(body: Record<string, unknown>)
| 79 | |
| 80 | /** Pull `user.email` out of a token response (WorkOS returns the user inline). */ |
| 81 | const readUserEmail = (body: Record<string, unknown>): string | undefined => { |
| 82 | const user = body.user; |
| 83 | if (user && typeof user === "object" && "email" in user) { |
| 84 | return asString((user as { email?: unknown }).email); |
| 85 | } |
| 86 | return undefined; |
| 87 | }; |
| 88 | |
| 89 | /** |
| 90 | * Decode a JWT access token's claims WITHOUT verifying it. The CLI only uses |
no test coverage detected