(body: string, secret: string, timestamp = Date.now())
| 1242 | |
| 1243 | /** The `WorkOS-Signature` header WorkOS sends: `t=<ms>, v1=<hmac-sha256 hex>`. */ |
| 1244 | const signature = (body: string, secret: string, timestamp = Date.now()) => |
| 1245 | `t=${timestamp}, v1=${createHmac("sha256", secret).update(`${timestamp}.${body}`).digest("hex")}`; |
| 1246 | |
| 1247 | const post = (body: string, headers: Record<string, string>) => |
| 1248 | new Request(`http://test.local${WORKOS_WEBHOOK_PATH}`, { |
no test coverage detected