Use idToken expiry because that's the time checked for refresh

RefreshSessionIfNeeded checks the token expiry, we want to use
the ID token's expiry
This commit is contained in:
Brian Van Klaveren 2019-02-12 10:32:26 -08:00
parent 8083501da6
commit b895f49c52

View File

@ -128,7 +128,7 @@ func (p *OIDCProvider) createSessionState(ctx context.Context, token *oauth2.Tok
IDToken: rawIDToken,
RefreshToken: token.RefreshToken,
CreatedAt: time.Now(),
ExpiresOn: token.Expiry,
ExpiresOn: idToken.Expiry,
Email: claims.Email,
User: claims.Subject,
}, nil