mirror of
https://github.com/bitwarden/server
synced 2025-12-10 13:23:27 +00:00
Start Migration from Newtonsoft.Json to System.Text.Json (#1803)
* Start switch to System.Text.Json * Work on switching to System.Text.Json * Main work on STJ refactor * Fix build errors * Run formatting * Delete unused file * Use legacy for two factor providers * Run formatter * Add TokenProviderTests * Run formatting * Fix merge issues * Switch to use JsonSerializer * Address PR feedback * Fix formatting * Ran formatter * Switch to async * Ensure Enums are serialized as strings * Fix formatting * Enqueue single items as arrays * Remove CreateAsync method on AzureQueueService
This commit is contained in:
@@ -3,8 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
using System.Net.Http;
|
||||
using System.Text.Json;
|
||||
using Bit.Migrator;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Bit.Setup
|
||||
{
|
||||
@@ -273,8 +273,9 @@ namespace Bit.Setup
|
||||
}
|
||||
|
||||
var resultString = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
|
||||
var result = JsonConvert.DeserializeObject<dynamic>(resultString);
|
||||
if (!(bool)result.Enabled)
|
||||
using var jsonDocument = JsonSerializer.Deserialize<JsonDocument>(resultString);
|
||||
var root = jsonDocument.RootElement;
|
||||
if (!root.GetProperty("Enabled").GetBoolean())
|
||||
{
|
||||
Console.WriteLine("Installation id has been disabled.");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user