@hookflo/tern 2.2.5 → 2.2.7
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/dist/verifiers/base.d.ts
CHANGED
package/dist/verifiers/base.js
CHANGED
|
@@ -9,7 +9,9 @@ class WebhookVerifier {
|
|
|
9
9
|
}
|
|
10
10
|
isTimestampValid(timestamp) {
|
|
11
11
|
const now = Math.floor(Date.now() / 1000);
|
|
12
|
-
|
|
12
|
+
// WorkOS sends milliseconds — auto-detect by magnitude
|
|
13
|
+
const timestampInSeconds = timestamp > 1e12 ? Math.floor(timestamp / 1000) : timestamp;
|
|
14
|
+
return Math.abs(now - timestampInSeconds) <= this.toleranceInSeconds;
|
|
13
15
|
}
|
|
14
16
|
safeCompare(a, b) {
|
|
15
17
|
if (a.length !== b.length) {
|
package/package.json
CHANGED