diff --git a/internal/site/auth.go b/internal/site/auth.go index 3dca43a..603f63a 100644 --- a/internal/site/auth.go +++ b/internal/site/auth.go @@ -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)