From 9f5269f7a3b6956e257b415af67094738d2ba88a Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 30 Mar 2026 19:39:23 +0700 Subject: lib/paseto: make the DriftSeconds changeable This is to make user can increases or decreases the leeway during Payload Validate. --- lib/paseto/payload.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/paseto/payload.go b/lib/paseto/payload.go index b5b458bd..d1086b45 100644 --- a/lib/paseto/payload.go +++ b/lib/paseto/payload.go @@ -11,7 +11,9 @@ import ( // DriftSeconds defines the time differences in seconds allowed in // [Payload.ExpiredAt] and [Payload.NotBefore]. -const DriftSeconds = 5 +// This value can be changes to increases or decreases the leeway during +// [Payload.Validate]. +var DriftSeconds int64 = 5 // List of errors for [Payload.Validate]. var ( -- cgit v1.3