@workos-inc/node 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/webhooks/webhooks.js
CHANGED
|
@@ -38,6 +38,7 @@ class Webhooks {
|
|
|
38
38
|
return [timestamp, signatureHash];
|
|
39
39
|
}
|
|
40
40
|
computeSignature(timestamp, payload, secret) {
|
|
41
|
+
payload = JSON.stringify(payload);
|
|
41
42
|
const signedPayload = `${timestamp}.${payload}`;
|
|
42
43
|
const expectedSignature = crypto_1.default
|
|
43
44
|
.createHmac('sha256', secret)
|
|
@@ -19,7 +19,7 @@ describe('Webhooks', () => {
|
|
|
19
19
|
payload = webhook_json_1.default;
|
|
20
20
|
secret = 'secret';
|
|
21
21
|
timestamp = Date.now() * 1000;
|
|
22
|
-
unhashedString = `${timestamp}.${payload}`;
|
|
22
|
+
unhashedString = `${timestamp}.${JSON.stringify(payload)}`;
|
|
23
23
|
signatureHash = crypto_1.default
|
|
24
24
|
.createHmac('sha256', secret)
|
|
25
25
|
.update(unhashedString)
|
package/lib/workos.js
CHANGED
|
@@ -22,7 +22,7 @@ const passwordless_1 = require("./passwordless/passwordless");
|
|
|
22
22
|
const portal_1 = require("./portal/portal");
|
|
23
23
|
const sso_1 = require("./sso/sso");
|
|
24
24
|
const webhooks_1 = require("./webhooks/webhooks");
|
|
25
|
-
const VERSION = '2.1.
|
|
25
|
+
const VERSION = '2.1.1';
|
|
26
26
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
27
27
|
class WorkOS {
|
|
28
28
|
constructor(key, options = {}) {
|
package/package.json
CHANGED