aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-03-30 19:39:23 +0700
committerShulhan <ms@kilabit.info>2026-03-30 21:07:31 +0700
commit9f5269f7a3b6956e257b415af67094738d2ba88a (patch)
tree8445896b465f14ee8316e9eddba154bd5ab0ae55
parent7af6aa612bc60df120d7580c9e436b24d2326394 (diff)
downloadpakakeh.go-9f5269f7a3b6956e257b415af67094738d2ba88a.tar.xz
lib/paseto: make the DriftSeconds changeable
This is to make user can increases or decreases the leeway during Payload Validate.
-rw-r--r--lib/paseto/payload.go4
1 files changed, 3 insertions, 1 deletions
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 (