Skip to content

Commit

Permalink
Make expirydelta configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
cgostuff committed Nov 14, 2021
1 parent d3ed0bb commit ec647e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion token.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec647e7

Please sign in to comment.