|
1 | 1 | using System;
|
2 | 2 | using Bit.Core.Abstractions;
|
3 | 3 | using System.Collections.Generic;
|
4 |
| -using System.Diagnostics; |
5 | 4 | using System.Linq;
|
6 | 5 | using System.Threading.Tasks;
|
7 | 6 | using Bit.Core.Enums;
|
8 | 7 | using Bit.Core.Models.Data;
|
9 | 8 | using Bit.Core.Models.Domain;
|
10 | 9 | using Bit.Core.Models.View;
|
11 | 10 | using Bit.Core.Utilities;
|
12 |
| -using Newtonsoft.Json; |
13 | 11 |
|
14 | 12 | namespace Bit.Core.Services
|
15 | 13 | {
|
@@ -1183,20 +1181,16 @@ public async Task SetTwoFactorTokenAsync(string value, string email = null)
|
1183 | 1181 |
|
1184 | 1182 | private async Task<T> GetValueAsync<T>(string key, StorageOptions options)
|
1185 | 1183 | {
|
1186 |
| - var value = await GetStorageService(options).GetAsync<T>(key); |
1187 |
| - Log("GET", options, key, JsonConvert.SerializeObject(value)); |
1188 |
| - return value; |
| 1184 | + return await GetStorageService(options).GetAsync<T>(key); |
1189 | 1185 | }
|
1190 | 1186 |
|
1191 | 1187 | private async Task SetValueAsync<T>(string key, T value, StorageOptions options)
|
1192 | 1188 | {
|
1193 | 1189 | if (value == null)
|
1194 | 1190 | {
|
1195 |
| - Log("REMOVE", options, key, null); |
1196 | 1191 | await GetStorageService(options).RemoveAsync(key);
|
1197 | 1192 | return;
|
1198 | 1193 | }
|
1199 |
| - Log("SET", options, key, JsonConvert.SerializeObject(value)); |
1200 | 1194 | await GetStorageService(options).SaveAsync(key, value);
|
1201 | 1195 | }
|
1202 | 1196 |
|
@@ -1512,19 +1506,12 @@ private bool UseDisk(StorageOptions options)
|
1512 | 1506 |
|
1513 | 1507 | private async Task<State> GetStateFromStorageAsync()
|
1514 | 1508 | {
|
1515 |
| - var state = await _storageService.GetAsync<State>(Constants.StateKey); |
1516 |
| - // TODO Remove logging once all bugs are squished |
1517 |
| - Debug.WriteLine(JsonConvert.SerializeObject(state, Formatting.Indented), |
1518 |
| - ">>> GetStateFromStorageAsync()"); |
1519 |
| - return state; |
| 1509 | + return await _storageService.GetAsync<State>(Constants.StateKey); |
1520 | 1510 | }
|
1521 | 1511 |
|
1522 | 1512 | private async Task SaveStateToStorageAsync(State state)
|
1523 | 1513 | {
|
1524 | 1514 | await _storageService.SaveAsync(Constants.StateKey, state);
|
1525 |
| - // TODO Remove logging once all bugs are squished |
1526 |
| - Debug.WriteLine(JsonConvert.SerializeObject(state, Formatting.Indented), |
1527 |
| - ">>> SaveStateToStorageAsync()"); |
1528 | 1515 | }
|
1529 | 1516 |
|
1530 | 1517 | private async Task CheckStateAsync()
|
@@ -1567,17 +1554,5 @@ private async Task ValidateUserAsync(string userId)
|
1567 | 1554 | }
|
1568 | 1555 | throw new Exception("User does not exist in account list");
|
1569 | 1556 | }
|
1570 |
| - |
1571 |
| - private void Log(string tag, StorageOptions options, string key, string value) |
1572 |
| - { |
1573 |
| - // TODO Remove this once all bugs are squished |
1574 |
| - var text = options?.UseSecureStorage ?? false ? "SECURE / " : ""; |
1575 |
| - text += "Key: " + key + " / "; |
1576 |
| - if (value != null) |
1577 |
| - { |
1578 |
| - text += "Value: " + value; |
1579 |
| - } |
1580 |
| - Debug.WriteLine(text, ">>> " + tag); |
1581 |
| - } |
1582 | 1557 | }
|
1583 | 1558 | }
|
0 commit comments