diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index 5a3081e..cbbe21b 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -55,7 +55,7 @@ namespace CarCareTracker.Controllers { try { - var configFileContents = System.IO.File.ReadAllText("userconfig/userConfig.json"); + var configFileContents = System.IO.File.ReadAllText("config/userConfig.json"); var existingUserConfig = System.Text.Json.JsonSerializer.Deserialize(configFileContents); if (existingUserConfig is not null) { @@ -69,7 +69,7 @@ namespace CarCareTracker.Controllers userConfig.UserNameHash = string.Empty; userConfig.UserPasswordHash = string.Empty; } - System.IO.File.WriteAllText("userconfig/userConfig.json", System.Text.Json.JsonSerializer.Serialize(userConfig)); + System.IO.File.WriteAllText("config/userConfig.json", System.Text.Json.JsonSerializer.Serialize(userConfig)); return Json(true); } catch (Exception ex) { diff --git a/Controllers/LoginController.cs b/Controllers/LoginController.cs index 87c7f0e..e2432aa 100644 --- a/Controllers/LoginController.cs +++ b/Controllers/LoginController.cs @@ -36,7 +36,7 @@ namespace CarCareTracker.Controllers //compare it against hashed credentials try { - var configFileContents = System.IO.File.ReadAllText("userconfig/userConfig.json"); + var configFileContents = System.IO.File.ReadAllText("config/userConfig.json"); var existingUserConfig = System.Text.Json.JsonSerializer.Deserialize(configFileContents); if (existingUserConfig is not null) { @@ -74,7 +74,7 @@ namespace CarCareTracker.Controllers { try { - var configFileContents = System.IO.File.ReadAllText("userconfig/userConfig.json"); + var configFileContents = System.IO.File.ReadAllText("config/userConfig.json"); var existingUserConfig = JsonSerializer.Deserialize(configFileContents); if (existingUserConfig is not null) { @@ -86,7 +86,7 @@ namespace CarCareTracker.Controllers existingUserConfig.UserNameHash = hashedUserName; existingUserConfig.UserPasswordHash = hashedPassword; } - System.IO.File.WriteAllText("userconfig/userConfig.json", JsonSerializer.Serialize(existingUserConfig)); + System.IO.File.WriteAllText("config/userConfig.json", JsonSerializer.Serialize(existingUserConfig)); return Json(true); } catch (Exception ex) @@ -101,7 +101,7 @@ namespace CarCareTracker.Controllers { try { - var configFileContents = System.IO.File.ReadAllText("userconfig/userConfig.json"); + var configFileContents = System.IO.File.ReadAllText("config/userConfig.json"); var existingUserConfig = JsonSerializer.Deserialize(configFileContents); if (existingUserConfig is not null) { @@ -110,7 +110,7 @@ namespace CarCareTracker.Controllers existingUserConfig.UserNameHash = string.Empty; existingUserConfig.UserPasswordHash = string.Empty; } - System.IO.File.WriteAllText("userconfig/userConfig.json", JsonSerializer.Serialize(existingUserConfig)); + System.IO.File.WriteAllText("config/userConfig.json", JsonSerializer.Serialize(existingUserConfig)); //destroy any login cookies. Response.Cookies.Delete("ACCESS_TOKEN"); return Json(true); diff --git a/Program.cs b/Program.cs index 7a26430..bd2f83b 100644 --- a/Program.cs +++ b/Program.cs @@ -23,7 +23,7 @@ if (!Directory.Exists("data")) } //Additional JsonFile -builder.Configuration.AddJsonFile("userconfig/userConfig.json", optional: true, reloadOnChange: true); +builder.Configuration.AddJsonFile("config/userConfig.json", optional: true, reloadOnChange: true); //Configure Auth builder.Services.AddDataProtection();