Skip to content

Commit 4c92b6a

Browse files
committed
TD-6277 Nonce console errors but not gmt.js
Comment: May be desireable to consider a task to pass the nonce in header, base controller in viewbag and randomly generate it
1 parent abde8c1 commit 4c92b6a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

DigitalLearningSolutions.Web/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ public void Configure(IApplicationBuilder app, IMigrationRunner migrationRunner,
658658
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}")
659659
);
660660

661-
migrationRunner.MigrateUp();
661+
migrationRunner.MigrateUp();
662662
}
663663

664664
private Task RedirectToLogin(RedirectContext<CookieAuthenticationOptions> context)

DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/_Layout.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
{
5151
@await Html.PartialAsync("~/Views/Shared/_GoogleTagManagerBodyTagJs.cshtml")
5252
}
53-
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' nhsuk-frontend-supported' : '');</script>
53+
<script nonce="random772362">document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' nhsuk-frontend-supported' : '');</script>
5454
<a class="nhsuk-skip-link" href="#maincontent">Skip to main content</a>
5555
<div id="pagewrapper">
5656
<header class="nhsuk-header nhsuk-header--transactional" role="banner">

DigitalLearningSolutions.Web/Views/Shared/_Layout.cshtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<link rel="icon" href="@Url.Content("~/assets/images/favicon.ico")" sizes="48x48">
5050

5151
<!-- Icons -->
52+
<!--qqqq these are not being found-->
5253
<link rel="icon" href="@Url.Content("~/assets/images/favicon.svg")" sizes="any" type="image/svg+xml">
5354
<link rel="mask-icon" href="@Url.Content("~/assets/images/nhsuk-icon-mask.svg")" color="#005eb8">
5455
<link rel="apple-touch-icon" href="@Url.Content("~/assets/images/nhsuk-icon-180.png")">
@@ -64,13 +65,13 @@
6465
<meta name="twitter:title" content="@(ViewData["twitter:title"] ?? ViewData[LayoutViewDataKeys.Title] ?? "Digital Learning Solutions")">
6566
<meta name="twitter:description" content="@(ViewData["twitter:description"] ?? "")">
6667
</head>
67-
68-
<body>
68+
<!-- qqqq go back to the docs do all bodys want this -->
69+
<body class="nhsuk-frontend-supported">
6970
@if (cookieConsent == "true")
7071
{
7172
@await Html.PartialAsync("~/Views/Shared/_GoogleTagManagerBodyTagJs.cshtml")
7273
}
73-
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' nhsuk-frontend-supported' : '');</script>
74+
<script nonce="random772362">document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' nhsuk-frontend-supported' : '');</script>
7475
<a class="nhsuk-skip-link" href="#maincontent">Skip to main content</a>
7576
<div id="pagewrapper">
7677
<header class="nhsuk-header nhsuk-header--transactional nhsuk-header--white" role="banner">

0 commit comments

Comments
 (0)