Skip to content

Commit

Permalink
Merge pull request #92 from cabinetoffice/NTRNL-511-update-header-wit…
Browse files Browse the repository at this point in the history
…h-signout-link

Add sign-out link to header
  • Loading branch information
harley-harris authored Jul 10, 2024
2 parents 509f4d9 + 4da3458 commit 56a9fff
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@aws-sdk/lib-dynamodb": "^3.585.0",
"@co-digital/api-sdk": "^1.0.6",
"@co-digital/logging": "^1.0.1",
"@co-digital/login": "^1.0.3",
"@co-digital/login": "^1.0.4",
"cookie-parser": "^1.4.6",
"cookie-session": "^2.1.0",
"cors": "^2.8.5",
Expand Down
2 changes: 1 addition & 1 deletion src/config/helmet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const configureHelmet = (app: express.Application) => {
directives: {
defaultSrc: ["'self'"],
fontSrc: ["'self'", config.CDN_HOST],
styleSrc: ["'self'", config.CDN_HOST],
styleSrc: ["'self'", "'unsafe-hashes'", "'sha256-6FWIojjtZwiNizws7ImlHjGH3DA5yMh5x4c+/4UVpXk='", config.CDN_HOST],
scriptSrc: [
"'self'",
"'sha256-l1eTVSK8DTnK8+yloud7wZUqFrI0atVo6VlC6PJvYaQ='",
Expand Down
10 changes: 10 additions & 0 deletions src/views/include/sign-out.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% if userEmailAuth or userEmail %}
<ul class="govuk-list" style="float: right;">
<li class="govuk-list govuk-!-margin-top-2">
<p class="govuk-body">
{{ userEmailAuth | default(userEmail) }} |
<a class="govuk-link govuk-link--no-underline govuk-link--no-visited-state" href={{ ROUTES.SIGN_OUT_URL }}>Sign out</a>
</p>
</li>
</ul>
{% endif %}
5 changes: 3 additions & 2 deletions src/views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}

{% block head %}
<link rel="stylesheet" type="text/css" media="all" href="//{{CDN_HOST}}/stylesheets/govuk-frontend/v3.11.0/govuk-frontend-3.11.0.min.css">
<link rel="stylesheet" type="text/css" media="all" href="//{{CDN_HOST}}/govuk-frontend/v5.3.0/govuk-frontend-5.3.0.min.css">

<link rel="SHORTCUT ICON" href="//{{CDN_HOST}}/images/favicon.ico"/>
<link rel="icon" href="//{{CDN_HOST}}/images/favicon.ico" type="image/x-icon"/>
Expand All @@ -44,6 +44,7 @@

{% block beforeContent %}
{% include "include/phase-banner.html" %}
{% include "include/sign-out.html" %}
{% block backLink %}
{% endblock %}
{% endblock %}
Expand Down Expand Up @@ -86,6 +87,6 @@
{% if FEATURE_FLAG_ENABLE_COOKIE_BANNER == "true" %}
<script src="/assets/javascripts/cookies.js"></script>
{% endif %}
<script src="//{{CDN_HOST}}/javascripts/govuk-frontend/v3.11.0/govuk-frontend-3.11.0.min.js"></script>
<script src="//{{CDN_HOST}}/govuk-frontend/v5.3.0/govuk-frontend-5.3.0.min.js"></script>
<script>window.GOVUKFrontend.initAll()</script>
{% endblock %}
2 changes: 1 addition & 1 deletion test/mock/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const MOCK_HELMET_VALUE = {
directives: {
defaultSrc: ["'self'"],
fontSrc: ["'self'", config.CDN_HOST],
styleSrc: ["'self'", config.CDN_HOST],
styleSrc: ["'self'", "'unsafe-hashes'", "'sha256-6FWIojjtZwiNizws7ImlHjGH3DA5yMh5x4c+/4UVpXk='", config.CDN_HOST],
scriptSrc: [
"'self'",
// Hash of the inline scripts respectively for:
Expand Down

0 comments on commit 56a9fff

Please sign in to comment.