Skip to content

Commit ec647e7

Browse files
committed
Make expirydelta configurable
1 parent d3ed0bb commit ec647e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

token.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ import (
1919
// expiryDelta determines how earlier a token should be considered
2020
// expired than its actual expiration time. It is used to avoid late
2121
// expirations due to client-server time mismatches.
22-
const expiryDelta = 10 * time.Second
22+
var expiryDelta = 10 * time.Second
23+
24+
// make expiryDelta configurable
25+
func SetExpiryDelta(seconds int){
26+
expiryDelta = time.Duration(seconds) * time.Second
27+
}
2328

2429
// Token represents the credentials used to authorize
2530
// the requests to access protected resources on the OAuth 2.0

0 commit comments

Comments
 (0)