Skip to content

Commit 551ce95

Browse files
Add ability to switch between organisations without signing out (#564)
This adds a 'Change' link in the account section of the header, for those users who have an account at more than one organisation: <img width="987" height="149" alt="Screenshot 2025-12-02 at 23 32 00" src="https://github.com/user-attachments/assets/8921c93b-7bde-47b3-a188-c9fd48e4a57c" /> The change link takes them back to a screen where they can select an organisation. <img width="795" height="369" alt="Screenshot 2025-12-02 at 23 32 45" src="https://github.com/user-attachments/assets/8b98c2df-d746-4f1a-8ee9-c2c6b8c24e27" /> This avoids the need to have to log out and log back in again.
1 parent def63d8 commit 551ce95

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/views/includes/header.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@
102102

103103
{% endif %}
104104

105+
{% set organisationHtml %}
106+
{{ currentOrganisation.name | truncate(30) }}
107+
{% if currentUser and currentOrganisation and ((currentUser.organisations | length) > 1) %}
108+
<a href="/auth/select-organisation" class="nhsuk-link--reverse">Change<span class="nhsuk-u-visually-hidden"> organisation</span></a>
109+
{% endif %}
110+
{% endset %}
111+
105112
{{ header({
106113
service: {
107114
text: "Record a vaccination",
@@ -115,7 +122,7 @@
115122
icon: true
116123
} if currentUser,
117124
{
118-
text: (currentOrganisation.name | truncate(30))
125+
html: organisationHtml
119126
} if currentOrganisation,
120127
{
121128
href: '/sign-out',

app/views/user-profile/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1 class="nhsuk-heading-l">Your profile</h1>
2525
{% endset %}
2626

2727
{% set organisationHtml %}
28-
<div>{{ currentOrganisation.name }}</div>
28+
<div>{{ currentOrganisation.name }} ({{ currentOrganisation.id }})</div>
2929
{% if currentOrganisation.type != "Region" %}
3030
<p class="app-summary__explanation">
3131
{{ currentOrganisation.address.line1 }}, {{ currentOrganisation.address.postcode }}

0 commit comments

Comments
 (0)