diff --git a/CHANGELOG.md b/CHANGELOG.md index d97ec5431..dfc0467fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased][unreleased] +### Changed +- Fix Privacy page having incorrect width +- Update name of cookie consent cookie to be consistent with application name and what is displayed in the Cookie UI + ## [Release-18][release-18] (production-2024-12-19.4567) ### Added diff --git a/DfE.FindInformationAcademiesTrusts/Authorization/AutomationAuthorizationHandler.cs b/DfE.FindInformationAcademiesTrusts/Authorization/AutomationAuthorizationHandler.cs index 257ceb46b..1f4424c2b 100644 --- a/DfE.FindInformationAcademiesTrusts/Authorization/AutomationAuthorizationHandler.cs +++ b/DfE.FindInformationAcademiesTrusts/Authorization/AutomationAuthorizationHandler.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using System.Security.Claims; +using DfE.FindInformationAcademiesTrusts.Extensions; using DfE.FindInformationAcademiesTrusts.Options; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization.Infrastructure; diff --git a/DfE.FindInformationAcademiesTrusts/Configuration/FiatCookies.cs b/DfE.FindInformationAcademiesTrusts/Configuration/FiatCookies.cs new file mode 100644 index 000000000..068dd0200 --- /dev/null +++ b/DfE.FindInformationAcademiesTrusts/Configuration/FiatCookies.cs @@ -0,0 +1,8 @@ +namespace DfE.FindInformationAcademiesTrusts.Configuration; + +public static class FiatCookies +{ + public const string Antiforgery = ".FindInformationAcademiesTrusts.Antiforgery"; + public const string CookieConsent = ".FindInformationAcademiesTrusts.CookieConsent"; + public const string Login = ".FindInformationAcademiesTrusts.Login"; +} diff --git a/DfE.FindInformationAcademiesTrusts/CookiesHelper.cs b/DfE.FindInformationAcademiesTrusts/CookiesHelper.cs index 0a697af5a..5c2b8118c 100644 --- a/DfE.FindInformationAcademiesTrusts/CookiesHelper.cs +++ b/DfE.FindInformationAcademiesTrusts/CookiesHelper.cs @@ -1,10 +1,10 @@ -using Microsoft.AspNetCore.Mvc.ViewFeatures; +using DfE.FindInformationAcademiesTrusts.Configuration; +using Microsoft.AspNetCore.Mvc.ViewFeatures; namespace DfE.FindInformationAcademiesTrusts; public static class CookiesHelper { - public const string ConsentCookieName = ".FindInformationAcademiesTrust.CookieConsent"; public const string DeleteCookieTempDataName = "DeleteCookie"; public const string CookieChangedTempDataName = "CookieResponse"; public const string ReturnPathQuery = "returnPath"; @@ -22,8 +22,8 @@ public static bool OptionalCookiesAreAccepted(HttpContext context, ITempDataDict return false; } - return context.Request.Cookies.ContainsKey(ConsentCookieName) && - bool.Parse(context.Request.Cookies[ConsentCookieName]!); + return context.Request.Cookies.ContainsKey(FiatCookies.CookieConsent) && + bool.Parse(context.Request.Cookies[FiatCookies.CookieConsent]!); } public static string ReturnPath(HttpContext context) @@ -35,7 +35,7 @@ public static string ReturnPath(HttpContext context) public static bool ShowCookieBanner(HttpContext context, ITempDataDictionary tempData) { - return !context.Request.Cookies.ContainsKey(ConsentCookieName) && + return !context.Request.Cookies.ContainsKey(FiatCookies.CookieConsent) && tempData[DeleteCookieTempDataName] is null; } } diff --git a/DfE.FindInformationAcademiesTrusts/EnvironmentExtensions.cs b/DfE.FindInformationAcademiesTrusts/Extensions/EnvironmentExtensions.cs similarity index 94% rename from DfE.FindInformationAcademiesTrusts/EnvironmentExtensions.cs rename to DfE.FindInformationAcademiesTrusts/Extensions/EnvironmentExtensions.cs index dabb88025..243615356 100644 --- a/DfE.FindInformationAcademiesTrusts/EnvironmentExtensions.cs +++ b/DfE.FindInformationAcademiesTrusts/Extensions/EnvironmentExtensions.cs @@ -1,4 +1,4 @@ -namespace DfE.FindInformationAcademiesTrusts; +namespace DfE.FindInformationAcademiesTrusts.Extensions; public static class EnvironmentExtensions { diff --git a/DfE.FindInformationAcademiesTrusts/Pages/Cookies.cshtml b/DfE.FindInformationAcademiesTrusts/Pages/Cookies.cshtml index b4452fe59..4ea3c3af8 100644 --- a/DfE.FindInformationAcademiesTrusts/Pages/Cookies.cshtml +++ b/DfE.FindInformationAcademiesTrusts/Pages/Cookies.cshtml @@ -1,157 +1,158 @@ @page +@using DfE.FindInformationAcademiesTrusts.Configuration @model CookiesModel @{ - Layout = "_ContentLayout"; - ViewData["Title"] = "Cookies"; + Layout = "_ContentLayout"; + ViewData["Title"] = "Cookies"; } @if (Model.DisplayCookieChangedMessageOnCookiesPage) { -