From 8da500e0f62c050cab283818ddee6138d9982b5e Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Thu, 30 Apr 2026 12:45:18 -0400 Subject: [PATCH] chore: rename timestampSeconds to timestampMs in ActionsService The local variable was named `timestampSeconds` but holds a millisecond Unix timestamp (parsed from the `t=` value, which WorkOS sends in ms) and is compared against `DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()`. The math was correct; only the name was misleading. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/WorkOS.net/Services/Actions/ActionsService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WorkOS.net/Services/Actions/ActionsService.cs b/src/WorkOS.net/Services/Actions/ActionsService.cs index c11349f9..a520c129 100644 --- a/src/WorkOS.net/Services/Actions/ActionsService.cs +++ b/src/WorkOS.net/Services/Actions/ActionsService.cs @@ -47,10 +47,10 @@ public class ActionsService public void VerifyHeader(string payload, string sigHeader, string secret, int tolerance = DefaultTolerance) { var (timestamp, signature) = ParseSignatureHeader(sigHeader); - var timestampSeconds = long.Parse(timestamp); + var timestampMs = long.Parse(timestamp); var nowMs = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); - if (Math.Abs(nowMs - timestampSeconds) > tolerance * 1000L) + if (Math.Abs(nowMs - timestampMs) > tolerance * 1000L) { throw new InvalidOperationException("Timestamp outside of the tolerance zone."); }