From ec647e79a46f8c5c13002c7546a9feb7f353282a Mon Sep 17 00:00:00 2001 From: cgostuff Date: Sun, 14 Nov 2021 12:08:38 +0100 Subject: [PATCH] Make expirydelta configurable --- token.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/token.go b/token.go index 822720341..a0f657ca4 100644 --- a/token.go +++ b/token.go @@ -19,7 +19,12 @@ import ( // expiryDelta determines how earlier a token should be considered // expired than its actual expiration time. It is used to avoid late // expirations due to client-server time mismatches. -const expiryDelta = 10 * time.Second +var expiryDelta = 10 * time.Second + +// make expiryDelta configurable +func SetExpiryDelta(seconds int){ + expiryDelta = time.Duration(seconds) * time.Second +} // Token represents the credentials used to authorize // the requests to access protected resources on the OAuth 2.0