Skip to content

Commit 8ae77e4

Browse files
authored
Merge pull request #5 from TechnologyEnhancedLearning/rc-hot-fix
RC hot fix - Merge into RC
2 parents 3fdb3c7 + c9f6f09 commit 8ae77e4

File tree

13 files changed

+378
-394
lines changed

13 files changed

+378
-394
lines changed

Auth/LearningHub.Nhs.Auth/Configuration/WebSettings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,10 @@ public class WebSettings
5555
/// Gets or sets the SupportForm.
5656
/// </summary>
5757
public string SupportForm { get; set; }
58-
}
58+
59+
/// <summary>
60+
/// Gets or sets the SupportFeedbackForm.
61+
/// </summary>
62+
public string SupportFeedbackForm { get; set; }
63+
}
5964
}

Auth/LearningHub.Nhs.Auth/Controllers/AccountController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ private async Task<LoginViewModel> BuildLoginViewModelAsync(string returnUrl)
334334

335335
// Base _layout.cshtml template config
336336
this.ViewData["AuthMainTitle"] = loginClientTemplate.AuthMainTitle;
337+
this.ViewData["ClientUrl"] = loginClientTemplate.ClientUrl;
337338
this.ViewData["ClientLogoUrl"] = loginClientTemplate.ClientLogoUrl;
338339
this.ViewData["ClientLogoSrc"] = loginClientTemplate.ClientLogoSrc;
339340
this.ViewData["ClientLogoAltText"] = loginClientTemplate.ClientLogoAltText;
@@ -380,7 +381,6 @@ private async Task<LoginViewModel> BuildLoginViewModelAsync(string returnUrl)
380381
if (client != null)
381382
{
382383
allowLocal = client.EnableLocalLogin;
383-
384384
if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Any())
385385
{
386386
providers = providers.Where(provider => client.IdentityProviderRestrictions.Contains(provider.AuthenticationScheme)).ToList();

Auth/LearningHub.Nhs.Auth/Filters/SecurityHeadersAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override void OnResultExecuting(ResultExecutingContext context)
3737

3838
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
3939
////var csp = "default-src 'self'; object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';";
40-
var csp = "object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';";
40+
var csp = "object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts allow-popups; base-uri 'self';";
4141
//// also consider adding upgrade-insecure-requests once you have HTTPS in place for production
4242
////csp += "upgrade-insecure-requests;";
4343
//// also an example if you need client images to be displayed from twitter

Auth/LearningHub.Nhs.Auth/Styles/sso.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,6 @@ body {
1010
background-color: $nhsuk-grey-white;
1111
}
1212

13-
header {
14-
background-color: $nhsuk-blue;
15-
height: 112px;
16-
padding: 0 15px;
17-
}
18-
19-
footer {
20-
background-color: $nhsuk-blue;
21-
height: 130px;
22-
padding: 0 15px;
23-
position: absolute;
24-
left: 0;
25-
bottom: 0;
26-
width: 100%;
27-
}
28-
2913
a {
3014
text-decoration: underline;
3115
}

Auth/LearningHub.Nhs.Auth/Views/Shared/LearningHub/_Layout.cshtml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
<header class="nhsuk-header" role="banner">
3939
<partial name="~/Views/Shared/LearningHub/_NavPartial.cshtml" />
4040
</header>
41+
<div class="nhsuk-width-container app-width-container beta-banner">
42+
<span class="beta-banner__beta-box">BETA</span>
43+
<span class="beta-banner__text">This is a new platform - your <a href="@(settings.Value.SupportFeedbackForm)" target="_blank">feedback</a> will help us to improve it.</span>
44+
</div>
4145
<div class="nhsuk-width-container app-width-container--full">
4246
<main role="main" id="maincontent" class="nhsuk-main-wrapper app-main-wrapper--no-padding nhsuk-bg-white">
4347
@RenderBody()
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<div class="nhsuk-width-container nhsuk-header__container app-width-container @PreLoginClass()">
2-
<div class="nhsuk-header__logo">
3-
<a class="nhsuk-header__link nhsuk-header__link--service " href="/" aria-label="NHS homepage">
4-
<svg class="nhsuk-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 16" height="40" width="100">
5-
<path class="nhsuk-logo__background" fill="#005eb8" d="M0 0h40v16H0z"></path>
6-
<path class="nhsuk-logo__text" fill="#fff" d="M3.9 1.5h4.4l2.6 9h.1l1.8-9h3.3l-2.8 13H9l-2.7-9h-.1l-1.8 9H1.1M17.3 1.5h3.6l-1 4.9h4L25 1.5h3.5l-2.7 13h-3.5l1.1-5.6h-4.1l-1.2 5.6h-3.4M37.7 4.4c-.7-.3-1.6-.6-2.9-.6-1.4 0-2.5.2-2.5 1.3 0 1.8 5.1 1.2 5.1 5.1 0 3.6-3.3 4.5-6.4 4.5-1.3 0-2.9-.3-4-.7l.8-2.7c.7.4 2.1.7 3.2.7s2.8-.2 2.8-1.5c0-2.1-5.1-1.3-5.1-5 0-3.4 2.9-4.4 5.8-4.4 1.6 0 3.1.2 4 .6"></path>
7-
</svg>
8-
<span class="nhsuk-header__service-name">
9-
Learning Hub
10-
</span>
11-
</a>
12-
</div>
13-
<div class="nhsuk-header__mobile-only-nav">
14-
</div>
15-
<div class="nhsuk-account__login nhsuk-header__not-mobile">
16-
</div>
2+
<div class="nhsuk-header__logo">
3+
<a class="nhsuk-header__link nhsuk-header__link--service " href="https://@ViewData["ClientUrl"]" aria-label="NHS homepage">
4+
<svg class="nhsuk-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 16" height="40" width="100">
5+
<path class="nhsuk-logo__background" fill="#005eb8" d="M0 0h40v16H0z"></path>
6+
<path class="nhsuk-logo__text" fill="#fff" d="M3.9 1.5h4.4l2.6 9h.1l1.8-9h3.3l-2.8 13H9l-2.7-9h-.1l-1.8 9H1.1M17.3 1.5h3.6l-1 4.9h4L25 1.5h3.5l-2.7 13h-3.5l1.1-5.6h-4.1l-1.2 5.6h-3.4M37.7 4.4c-.7-.3-1.6-.6-2.9-.6-1.4 0-2.5.2-2.5 1.3 0 1.8 5.1 1.2 5.1 5.1 0 3.6-3.3 4.5-6.4 4.5-1.3 0-2.9-.3-4-.7l.8-2.7c.7.4 2.1.7 3.2.7s2.8-.2 2.8-1.5c0-2.1-5.1-1.3-5.1-5 0-3.4 2.9-4.4 5.8-4.4 1.6 0 3.1.2 4 .6"></path>
7+
</svg>
8+
<span class="nhsuk-header__service-name">
9+
Learning Hub
10+
</span>
11+
</a>
12+
</div>
13+
<div class="nhsuk-header__mobile-only-nav">
14+
</div>
15+
<div class="nhsuk-account__login nhsuk-header__not-mobile">
16+
</div>
1717
</div>
1818
@functions {
19-
public string PreLoginClass()
20-
{
21-
if (!User.Identity.IsAuthenticated) return "nhsuk-header__pre-login";
22-
return "";
23-
}
19+
public string PreLoginClass()
20+
{
21+
if (!User.Identity.IsAuthenticated) return "nhsuk-header__pre-login";
22+
return "";
23+
}
2424
}

Auth/LearningHub.Nhs.Auth/Views/Shared/_Signout_Layout.cshtml

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,49 @@
55
<!DOCTYPE html>
66
<html>
77
<head>
8-
<meta charset="utf-8" />
9-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10-
<title>@ViewData["Title"] - Learning Hub Authentication</title>
11-
12-
<environment include="Development">
13-
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
14-
<link rel="stylesheet" type="text/css" href="~/css/site.css" />
15-
<link rel="stylesheet" type="text/css" href="~/css/auth.css" />
16-
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.css" />
17-
</environment>
18-
<environment exclude="Development">
19-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"
20-
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
21-
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
22-
crossorigin="anonymous"
23-
integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" />
24-
25-
<link rel="stylesheet" type="text/css" href="~/css/site.min.css" />
26-
<link rel="stylesheet" type="text/css" href="~/css/auth.min.css" />
27-
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.min.css" />
28-
</environment>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10+
<title>@ViewData["Title"] - Learning Hub Authentication</title>
11+
<link rel="stylesheet" type="text/css" href="~/css/site.css" />
12+
<link rel="stylesheet" type="text/css" href="~/css/auth.css" />
13+
<environment include="Development">
14+
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
15+
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.css" />
16+
</environment>
17+
<environment exclude="Development">
18+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"
19+
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
20+
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
21+
crossorigin="anonymous"
22+
integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" />
23+
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.min.css" />
24+
</environment>
2925
</head>
3026
<body>
31-
<div class="container-fluid">
32-
<main role="main" id="maincontent" tabindex="-1">
33-
@RenderBody()
34-
</main>
35-
</div>
27+
<div class="container-fluid">
28+
<main role="main" id="maincontent" tabindex="-1">
29+
@RenderBody()
30+
</main>
31+
</div>
3632

37-
<environment include="Development">
38-
<script src="~/lib/jquery/dist/jquery.js"></script>
39-
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
40-
</environment>
41-
<environment exclude="Development">
42-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
43-
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
44-
asp-fallback-test="window.jQuery"
45-
crossorigin="anonymous"
46-
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
47-
</script>
48-
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"
49-
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
50-
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
51-
crossorigin="anonymous"
52-
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
53-
</script>
54-
</environment>
55-
@RenderSection("Scripts", required: false)
33+
<environment include="Development">
34+
<script src="~/lib/jquery/dist/jquery.js"></script>
35+
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
36+
</environment>
37+
<environment exclude="Development">
38+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
39+
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
40+
asp-fallback-test="window.jQuery"
41+
crossorigin="anonymous"
42+
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
43+
</script>
44+
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"
45+
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
46+
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
47+
crossorigin="anonymous"
48+
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
49+
</script>
50+
</environment>
51+
@RenderSection("Scripts", required: false)
5652
</body>
5753
</html>
Lines changed: 62 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,75 @@
11
@using IdentityServer4.Extensions
2+
@inject Microsoft.Extensions.Options.IOptions<LearningHub.Nhs.Auth.Configuration.WebSettings> settings
23
@{
3-
string name = null;
4-
if (!true.Equals(ViewData["signed-out"]))
5-
{
6-
name = Context.User?.GetDisplayName();
7-
}
4+
string name = null;
5+
if (!true.Equals(ViewData["signed-out"]))
6+
{
7+
name = Context.User?.GetDisplayName();
8+
}
89
}
910
<!DOCTYPE html>
1011
<html>
1112
<head>
12-
<meta charset="utf-8" />
13-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
14-
<title>@ViewData["Title"] - Learning Hub Authentication</title>
15-
16-
<environment include="Development">
17-
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
18-
<link rel="stylesheet" type="text/css" href="~/css/site.css" />
19-
<link rel="stylesheet" type="text/css" href="~/css/sso.css" />
20-
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.css" />
21-
</environment>
22-
<environment exclude="Development">
23-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"
24-
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
25-
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
26-
crossorigin="anonymous"
27-
integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" />
28-
29-
<link rel="stylesheet" type="text/css" href="~/css/site.min.css" />
30-
<link rel="stylesheet" type="text/css" href="~/css/sso.min.css" />
31-
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.min.css" />
32-
</environment>
13+
<meta charset="utf-8" />
14+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15+
<title>@ViewData["Title"] - Learning Hub Authentication</title>
16+
<link href="~/css/nhsuk/common.css" rel="stylesheet" asp-append-version="true" />
17+
<link href="~/css/nhsuk/layout.css" rel="stylesheet" asp-append-version="true" />
18+
<link rel="stylesheet" type="text/css" href="~/css/site.css" asp-append-version="true" />
19+
<link rel="stylesheet" type="text/css" href="~/css/auth.css" asp-append-version="true" />
20+
<link rel="stylesheet" type="text/css" href="~/css/sso.css" asp-append-version="true" />
21+
<environment include="Development">
22+
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" asp-append-version="true" />
23+
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.css" asp-append-version="true" />
24+
</environment>
25+
<environment exclude="Development">
26+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"
27+
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
28+
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
29+
crossorigin="anonymous"
30+
integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" />
31+
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.min.css" asp-append-version="true" />
32+
</environment>
3333
</head>
3434
<body>
35-
<header>
36-
<div class="lh-container">
37-
<div class="d-flex flex-column py-4 justify-content-between" style="height: 100%;">
38-
<div>
39-
<a href="/" id="home-link"><img src="/images/nhs-white.svg" alt="NHS"></a>
40-
</div>
41-
<div id="home-beta-link" class="header-title-sso">
42-
Learning Hub<sup class="header-beta">Beta</sup>
43-
</div>
44-
</div>
45-
</div>
46-
</header>
47-
48-
<div class="container-fluid">
49-
<main role="main" id="maincontent" tabindex="-1">
50-
@RenderBody()
51-
</main>
35+
<header class="nhsuk-header" role="banner">
36+
<partial name="~/Views/Shared/LearningHub/_NavPartial.cshtml" />
37+
<div id="home-beta-link" class="header-title-sso">
5238
</div>
39+
</header>
40+
<div class="nhsuk-width-container app-width-container beta-banner">
41+
<span class="beta-banner__beta-box">BETA</span>
42+
<span class="beta-banner__text">This is a new platform - your <a href="@(settings.Value.SupportFeedbackForm)" target="_blank">feedback</a> will help us to improve it.</span>
43+
</div>
44+
<div class="container-fluid">
45+
<main role="main" id="maincontent" tabindex="-1">
46+
@RenderBody()
47+
</main>
48+
</div>
5349

54-
<footer>
55-
<div class="lh-container">
56-
<div class="d-flex flex-column py-4 justify-content-between" style="height: 100%;">
57-
<div>
58-
<a href="/" id="home-link"><img src="/images/nhs-white.svg" alt="NHS"></a>
59-
</div>
60-
<div id="home-beta-link" class="header-title-sso">
61-
Learning Hub<sup class="header-beta">Beta</sup>
62-
</div>
63-
</div>
64-
</div>
65-
</footer>
66-
67-
<environment include="Development">
68-
<script src="~/lib/jquery/dist/jquery.js"></script>
69-
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
70-
</environment>
71-
<environment exclude="Development">
72-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
73-
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
74-
asp-fallback-test="window.jQuery"
75-
crossorigin="anonymous"
76-
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
77-
</script>
78-
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"
79-
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
80-
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
81-
crossorigin="anonymous"
82-
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
83-
</script>
84-
</environment>
50+
<footer role="contentinfo">
51+
<partial name="~/Views/Shared/LearningHub/_FooterPartial.cshtml" />
52+
</footer>
53+
<environment include="Development">
54+
<script src="~/lib/jquery/dist/jquery.js"></script>
55+
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
56+
</environment>
57+
<environment exclude="Development">
58+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
59+
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
60+
asp-fallback-test="window.jQuery"
61+
crossorigin="anonymous"
62+
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
63+
</script>
64+
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"
65+
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
66+
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
67+
crossorigin="anonymous"
68+
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
69+
</script>
70+
</environment>
8571

86-
<partial name="~/Views/Shared/_ValidationScriptsPartial.cshtml" />
87-
@RenderSection("Scripts", required: false)
72+
<partial name="~/Views/Shared/_ValidationScriptsPartial.cshtml" />
73+
@RenderSection("Scripts", required: false)
8874
</body>
8975
</html>

0 commit comments

Comments
 (0)