AUTH-1404: reauth if the token is about to expire within 15 minutes
This commit is contained in:
		
							parent
							
								
									aeb8dd7e51
								
							
						
					
					
						commit
						f7cf597f54
					
				|  | @ -62,7 +62,8 @@ func GetTokenIfExists(url *url.URL) (string, error) { | ||||||
| 		return "", err | 		return "", err | ||||||
| 	} | 	} | ||||||
| 	ident, err := oidc.IdentityFromClaims(claims) | 	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 token.Encode(), nil | ||||||
| 	} | 	} | ||||||
| 	return "", err | 	return "", err | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue