updated id token lifetime
This commit is contained in:
@@ -110,8 +110,9 @@ func (s *Server) authenticateAndAddIdentity(f response.HandlerFunc, assertions .
|
||||
|
||||
// refresh tokens, when the access token is "old enough"
|
||||
|
||||
const idTokenLifetime = 10 * time.Hour
|
||||
if refreshFloor := expiration.Add(-idTokenLifetime); refreshFloor.Before(now) {
|
||||
// id token lifetime is 48 hours, allowing a person to use the app everyday comfortably, with wiggle room, without having to log in.
|
||||
const idTokenLifetime = 48 * time.Hour
|
||||
if refreshFloor := expiration.Add(-(idTokenLifetime / 4)); refreshFloor.Before(now) {
|
||||
accessToken, expiration, err = s.auth.RefreshAccessToken(ctx, accessToken)
|
||||
if err != nil {
|
||||
fmt.Println("failed to refresh access token:", err)
|
||||
|
||||
Reference in New Issue
Block a user