AUTH-1404: reauth if the token is about to expire within 15 minutes

This commit is contained in:
Austin Cherry 2019-01-24 15:20:36 -06:00
parent aeb8dd7e51
commit f7cf597f54
1 changed files with 2 additions and 1 deletions

View File

@ -62,7 +62,8 @@ func GetTokenIfExists(url *url.URL) (string, error) {
return "", err
}
ident, err := oidc.IdentityFromClaims(claims)
if err == nil && ident.ExpiresAt.After(time.Now()) {
// AUTH-1404, reauth if the token is about to expire within 15 minutes
if err == nil && ident.ExpiresAt.After(time.Now().Add(time.Minute*15)) {
return token.Encode(), nil
}
return "", err