Skip to content

Commit a65252e

Browse files
authored
fix: Start page content & use APP_ENV rather than NODE_ENV (#1555)
* fix: use APP_ENV rather than NODE_ENV for Azure web app * fix: update start page content and remove redundant elements
1 parent 629b057 commit a65252e

6 files changed

Lines changed: 23 additions & 16 deletions

File tree

application/CohortManager/src/Web/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
# .env
88
SERVICE_NAME="Cohort Manager"
9+
APP_ENV="development"
910

1011
# Next Auth
1112
NEXTAUTH_URL=https://localhost:3000/api/auth

application/CohortManager/src/Web/.env.tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Default
22
NEXT_PUBLIC_BASE_URL=http://localhost:3000
3-
NODE_ENV=development
3+
APP_ENV=development
44
SERVICE_NAME="Cohort Manager"
55

66
# Next Auth

application/CohortManager/src/Web/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Create a `.env` file which should override environment variables required to run
1717
```text
1818
# Default
1919
SERVICE_NAME="Cohort Manager"
20+
APP_ENV="development"
2021
2122
# Next Auth
2223
NEXTAUTH_URL=https://localhost:3000/api/auth

application/CohortManager/src/Web/app/components/signIn.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,22 @@ export default function SignIn({
1717
<main className="nhsuk-main-wrapper" id="maincontent" role="main">
1818
<div className="nhsuk-grid-row">
1919
<div className="nhsuk-grid-column-two-thirds">
20-
<HeadingTag className="nhsuk-heading-xl">
21-
Log in with your Care Identity account
22-
</HeadingTag>
20+
<HeadingTag className="nhsuk-heading-xl">{serviceName}</HeadingTag>
21+
<p>For use with the NHS breast screening programme.</p>
22+
<p>You can use this service to:</p>
23+
<ul>
24+
<li>
25+
view a summary of outstanding exceptions occurring in participant
26+
data
27+
</li>
28+
<li>
29+
access information to raise a service request for the data to be
30+
corrected
31+
</li>
32+
</ul>
2333

24-
<p>
25-
Setup your account for {serviceName} using your Care Identity
26-
account.
27-
</p>
34+
<h2>Before you start</h2>
35+
<p>We&apos;ll ask you to log in with your Care Identity account.</p>
2836

2937
<p>
3038
If you are not currently using a computer with a smartcard reader
@@ -63,13 +71,10 @@ export default function SignIn({
6371
d="M80 0v32H0V0h80ZM69 2.2c-5.8 0-11.6 2-11.6 8.8 0 7.4 10.2 5.8 10.2 10 0 2.6-3.4 3-5.6 3-2.2 0-5-.6-6.4-1.4L54 28c2.2.8 5.4 1.4 8 1.4 6.2 0 12.8-1.8 12.8-9 0-7.8-10.2-6.6-10.2-10.2 0-2.2 2.2-2.6 5-2.6 2.6 0 4.4.6 5.8 1.2L77 3.4c-1.8-.8-4.8-1.2-8-1.2ZM16.6 3H7.8L2.2 29h6.6l3.6-18h.2L18 29h8.6l5.6-26h-6.6L22 21h-.2L16.6 3Zm25.2 0h-7.2l-5.2 26h6.8l2.4-11.2h8.2L44.6 29h7L57 3h-7l-2.2 9.8h-8l2-9.8Z"
6472
></path>
6573
</svg>
66-
67-
<div>
68-
<span>Log in with my</span> Care Identity
69-
</div>
74+
Log in with my Care Identity
7075
</button>
7176
</form>
72-
{process.env.NODE_ENV === "development" && (
77+
{process.env.APP_ENV === "development" && (
7378
<>
7479
<hr />
7580
<form

application/CohortManager/src/Web/app/lib/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const NHS_CIS2: OAuthConfig<Profile> = {
3232
export const { handlers, auth, signIn, signOut } = NextAuth({
3333
providers: [
3434
NHS_CIS2,
35-
...(process.env.NODE_ENV === "development"
35+
...(process.env.APP_ENV === "development"
3636
? [
3737
Credentials({
3838
credentials: {
@@ -64,7 +64,7 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
6464
async signIn({ account }) {
6565
// Handle test accounts in development
6666
if (
67-
process.env.NODE_ENV === "development" &&
67+
process.env.APP_ENV === "development" &&
6868
account?.provider === "credentials"
6969
) {
7070
return true;

infrastructure/tf-core/environments/development.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ linux_web_app = {
11601160
AUTH_TRUST_HOST = "true"
11611161
NEXTAUTH_URL = "https://cohort-dev.non-live.screening.nhs.uk/api/auth"
11621162
SERVICE_NAME = "Cohort Manager"
1163-
NODE_ENV = "development"
1163+
APP_ENV = "development"
11641164
}
11651165
from_key_vault = {
11661166
# env_var_name = "key_vault_secret_name"

0 commit comments

Comments
 (0)