public async Task <bool> UpdateRefreshedTokenAsync(bool emptyRefreshToken = false) { bool returnValue = false; if (IdUser == 0 || _firebaseService.RefreshedToken == null || _firebaseService.Equals("")) { return(returnValue); } string refreshedToken = _firebaseService.RefreshedToken; if (emptyRefreshToken) { refreshedToken = null; } var cancellationTokenSource = CreateCancellationTokenSource(); try { var json = JsonConvert.SerializeObject(new Dictionary <string, string>() { { "uid", IdUser.ToString() }, { "refreshedToken", refreshedToken } }); var httpContent = new StringContent(json, Encoding.UTF8, "application/json"); var responseMessage = await _httpClient.PostAsync(new Uri(UpdateRefreshedTokenUrl), httpContent, cancellationTokenSource.Token); if (responseMessage.StatusCode == HttpStatusCode.OK) { //returnValue = JsonConvert.DeserializeObject<User>(await responseMessage.Content.ReadAsStringAsync()); returnValue = true; } } catch (Exception e) { Logger.Error(e.Message); } finally { cancellationTokenSource?.DisposeIfDisposable(); } return(returnValue); }