/// <summary> /// Refreshes the live authentication access token if it has expired /// </summary> public static async Task <bool> RefreshAuthTokenIfNeeded() { var refreshed = false; if (AccessTokenExpiration.CompareTo(DateTimeOffset.UtcNow) <= 0) { await AttemptAccessTokenRefresh(); refreshed = true; } return(refreshed); }
public bool AccessTokenIsValid() { var timeValid = AccessTokenExpiration.CompareTo(DateTimeOffset.Now) > 0; return(!string.IsNullOrEmpty(AccessToken) && timeValid); }