diff --git a/.editorconfig b/.editorconfig index df812d2..5fff41b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,7 +4,7 @@ root = true insert_final_newline = true max_line_length = 100 -[*.{cs,cshtml,html,xml,js,css,csproj}] +[*.{cs,cshtml,html,xml,js,css,csproj,json}] indent_style = tab tab_width = 4 trim_trailing_whitespace = true diff --git a/Start/Client/obj/Debug/net5.0/Start.Client.csproj.AssemblyReference.cache b/Start/Client/obj/Debug/net5.0/Start.Client.csproj.AssemblyReference.cache deleted file mode 100644 index f5e894a..0000000 Binary files a/Start/Client/obj/Debug/net5.0/Start.Client.csproj.AssemblyReference.cache and /dev/null differ diff --git a/Start/Server/Areas/Identity/Pages/Shared/_LoginPartial.cshtml b/Start/Server/Areas/Identity/Pages/Shared/_LoginPartial.cshtml index a755029..c42c4af 100644 --- a/Start/Server/Areas/Identity/Pages/Shared/_LoginPartial.cshtml +++ b/Start/Server/Areas/Identity/Pages/Shared/_LoginPartial.cshtml @@ -6,30 +6,41 @@ @{ var returnUrl = "/"; - if (Context.Request.Query.TryGetValue("returnUrl", out var existingUrl)) { + if (Context.Request.Query.TryGetValue("returnUrl", out var existingUrl)) + { returnUrl = existingUrl; } } diff --git a/Start/Server/Controllers/OidcConfigurationController.cs b/Start/Server/Controllers/OidcConfigurationController.cs index 4a92243..5d6e99f 100644 --- a/Start/Server/Controllers/OidcConfigurationController.cs +++ b/Start/Server/Controllers/OidcConfigurationController.cs @@ -2,25 +2,23 @@ using Microsoft.AspNetCore.ApiAuthorization.IdentityServer; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -namespace Start.Server.Controllers -{ - public class OidcConfigurationController : Controller - { - private readonly ILogger _logger; +namespace Start.Server.Controllers { + public class OidcConfigurationController : Controller { + private readonly ILogger _logger; - public OidcConfigurationController(IClientRequestParametersProvider clientRequestParametersProvider, ILogger logger) - { - ClientRequestParametersProvider = clientRequestParametersProvider; - _logger = logger; - } + public OidcConfigurationController( + IClientRequestParametersProvider clientRequestParametersProvider, + ILogger logger) { + ClientRequestParametersProvider = clientRequestParametersProvider; + _logger = logger; + } - public IClientRequestParametersProvider ClientRequestParametersProvider { get; } + public IClientRequestParametersProvider ClientRequestParametersProvider { get; } - [HttpGet("_configuration/{clientId}")] - public IActionResult GetClientRequestParameters([FromRoute] string clientId) - { - var parameters = ClientRequestParametersProvider.GetClientParameters(HttpContext, clientId); - return Ok(parameters); - } - } + [HttpGet("_configuration/{clientId}")] + public IActionResult GetClientRequestParameters([FromRoute] string clientId) { + var parameters = ClientRequestParametersProvider.GetClientParameters(HttpContext, clientId); + return Ok(parameters); + } + } } diff --git a/Start/Server/Controllers/WeatherForecastController.cs b/Start/Server/Controllers/WeatherForecastController.cs index 273540f..8d6242d 100644 --- a/Start/Server/Controllers/WeatherForecastController.cs +++ b/Start/Server/Controllers/WeatherForecastController.cs @@ -7,36 +7,31 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Start.Shared; -namespace Start.Server.Controllers -{ - [Authorize] - [ApiController] - [Route("[controller]")] - public class WeatherForecastController : ControllerBase - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; +namespace Start.Server.Controllers { + [Authorize] + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; - private readonly ILogger _logger; + private readonly ILogger _logger; - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } + public WeatherForecastController(ILogger logger) { + _logger = logger; + } - [HttpGet] - public IEnumerable Get() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } - } + [HttpGet] + public IEnumerable Get() { + var rng = new Random(); + return Enumerable.Range(1, 5).Select(index => new WeatherForecast { + Date = DateTime.Now.AddDays(index), + TemperatureC = rng.Next(-20, 55), + Summary = Summaries[rng.Next(Summaries.Length)] + }) + .ToArray(); + } + } } diff --git a/Start/Server/Models/ApplicationUser.cs b/Start/Server/Models/ApplicationUser.cs index c15fdce..48a300a 100644 --- a/Start/Server/Models/ApplicationUser.cs +++ b/Start/Server/Models/ApplicationUser.cs @@ -4,10 +4,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace Start.Server.Models -{ - public class ApplicationUser : IdentityUser - { +namespace Start.Server.Models { + public class ApplicationUser : IdentityUser { /// The s that belong to this user public List? BookmarkContainers { get; set; } } diff --git a/Start/Server/Program.cs b/Start/Server/Program.cs index 779e2fb..23b523c 100644 --- a/Start/Server/Program.cs +++ b/Start/Server/Program.cs @@ -7,20 +7,16 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -namespace Start.Server -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } +namespace Start.Server { + public class Program { + public static void Main(string[] args) { + CreateHostBuilder(args).Build().Run(); + } - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => { + webBuilder.UseStartup(); + }); + } } diff --git a/Start/Server/Properties/launchSettings.json b/Start/Server/Properties/launchSettings.json index 8a40d21..a192a33 100644 --- a/Start/Server/Properties/launchSettings.json +++ b/Start/Server/Properties/launchSettings.json @@ -1,30 +1,30 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:14780", - "sslPort": 44310 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Start.Server": { - "commandName": "Project", - "dotnetRunMessages": "true", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } - } + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:14780", + "sslPort": 44310 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Start.Server": { + "commandName": "Project", + "dotnetRunMessages": "true", + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Start/Server/appsettings.Development.json b/Start/Server/appsettings.Development.json index 3203254..8ca6e15 100644 --- a/Start/Server/appsettings.Development.json +++ b/Start/Server/appsettings.Development.json @@ -1,14 +1,14 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "IdentityServer": { - "Key": { - "Type": "Development" - } - } + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "IdentityServer": { + "Key": { + "Type": "Development" + } + } } diff --git a/Start/Server/appsettings.json b/Start/Server/appsettings.json index 977b80e..832790b 100644 --- a/Start/Server/appsettings.json +++ b/Start/Server/appsettings.json @@ -1,20 +1,20 @@ { - "ConnectionStrings": { - "DefaultConnection": "DataSource=app.db" - }, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "IdentityServer": { - "Clients": { - "Start.Client": { - "Profile": "IdentityServerSPA" - } - } - }, -"AllowedHosts": "*" + "ConnectionStrings": { + "DefaultConnection": "DataSource=app.db" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "IdentityServer": { + "Clients": { + "Start.Client": { + "Profile": "IdentityServerSPA" + } + } + }, + "AllowedHosts": "*" }