diff --git a/bff/server/Controllers/AccountController.cs b/bff/server/Controllers/AccountController.cs index 4b5f225..be4d47e 100644 --- a/bff/server/Controllers/AccountController.cs +++ b/bff/server/Controllers/AccountController.cs @@ -16,8 +16,7 @@ public ActionResult Login(string? returnUrl, string? claimsChallenge) if (claimsChallenge != null) { - string jsonString = claimsChallenge.Replace("\\", "") - .Trim(new char[1] { '"' }); + string jsonString = claimsChallenge.Replace("\\", "").Trim('"'); properties.Items["claims"] = jsonString; } diff --git a/bff/server/Pages/Error.cshtml b/bff/server/Pages/Error.cshtml index cb8291c..3ef1473 100644 --- a/bff/server/Pages/Error.cshtml +++ b/bff/server/Pages/Error.cshtml @@ -2,7 +2,7 @@ @model BffOpenIddict.Server.Pages.ErrorModel - + diff --git a/bff/server/Pages/Error.cshtml.cs b/bff/server/Pages/Error.cshtml.cs index ff41097..cf8a0c5 100644 --- a/bff/server/Pages/Error.cshtml.cs +++ b/bff/server/Pages/Error.cshtml.cs @@ -5,7 +5,6 @@ namespace BffOpenIddict.Server.Pages; [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] -[IgnoreAntiforgeryToken] public class ErrorModel : PageModel { public string? RequestId { get; set; } diff --git a/bff/server/SecurityHeadersDefinitions.cs b/bff/server/SecurityHeadersDefinitions.cs index a271c70..ed81b23 100644 --- a/bff/server/SecurityHeadersDefinitions.cs +++ b/bff/server/SecurityHeadersDefinitions.cs @@ -4,10 +4,7 @@ public static class SecurityHeadersDefinitions { public static HeaderPolicyCollection GetHeaderPolicyCollection(bool isDev, string? idpHost) { - if(idpHost == null) - { - throw new ArgumentNullException(nameof(idpHost)); - } + ArgumentNullException.ThrowIfNull(idpHost); var policy = new HeaderPolicyCollection() .AddFrameOptionsDeny() @@ -34,7 +31,6 @@ public static HeaderPolicyCollection GetHeaderPolicyCollection(bool isDev, strin { builder.AddStyleSrc().WithNonce().UnsafeInline(); } - builder.AddScriptSrc().WithNonce().UnsafeInline(); })