diff --git a/app/assets/sass/components/_button.scss b/app/assets/sass/components/_button.scss index 29dc629f..b5b27a83 100644 --- a/app/assets/sass/components/_button.scss +++ b/app/assets/sass/components/_button.scss @@ -3,6 +3,10 @@ min-width: 80px; } +.app-button--min-width-2 { + min-width: 300px; +} + // Make buttons full width on mobile // This is temporary until https://github.com/nhsuk/nhsuk-frontend/pull/1309 is merged .nhsuk-button { diff --git a/app/routes/auth.js b/app/routes/auth.js index 7225ea4a..6f37a05b 100644 --- a/app/routes/auth.js +++ b/app/routes/auth.js @@ -6,7 +6,13 @@ module.exports = router => { const email = data.email || "jane.smith@nhs.net" const user = data.users.find((user) => user.email === email) - if (!user) { + if (email === 'freda.pink@nhs.net') { + res.redirect('/auth/keycloak-not-recognised') + return + } else if (email === 'james.blue@nhs.net') { + res.redirect('/auth/keycloak-existing-account-new-login') + return + } else if (!user) { res.redirect('/auth/okta-sign-in') return } diff --git a/app/views/_layouts/keycloak.html b/app/views/_layouts/keycloak.html new file mode 100644 index 00000000..8c8912cd --- /dev/null +++ b/app/views/_layouts/keycloak.html @@ -0,0 +1,14 @@ +{% extends "../layout.html" %} + +{% block header %} + {{ header({ + service: { + text: "RAVS Login" + } + }) }} +{% endblock %} + +{% block footer %} + {{ footer({ + }) }} +{% endblock %} diff --git a/app/views/auth/keycloak-existing-account-new-login.html b/app/views/auth/keycloak-existing-account-new-login.html new file mode 100644 index 00000000..33354397 --- /dev/null +++ b/app/views/auth/keycloak-existing-account-new-login.html @@ -0,0 +1,49 @@ +{% extends '_layouts/keycloak.html' %} + +{% set pageName = "Sign in" %} + + +{% block content %} +
+
+ +

You previously logged in a different way

+ +

Your email address {{ data.email }} is associated with a different log in method.

+ +

If you would like to be able to use both log in methods, first sign in using the way you used before:

+ + {{ button({ + text: "Log in with Okta", + classes: "app-button--min-width-2", + href: "/auth/okta-sign-in" + }) }} + +
+ {{ button({ + text: "Log in with PharmaPMR", + classes: "nhsuk-button--secondary app-button--min-width-2" + }) }} +
+ +
+ {{ button({ + text: "Log in with PharmacyPlus+", + classes: "nhsuk-button--secondary app-button--min-width-2" + }) }} +
+ +
+ {{ button({ + text: "Log in with Phoenix", + classes: "nhsuk-button--secondary app-button--min-width-2" + }) }} +
+ + +

We will then link both log in methods to your account and in future you can log in either way.

+ + +
+
+{% endblock %} diff --git a/app/views/auth/keycloak-not-recognised.html b/app/views/auth/keycloak-not-recognised.html new file mode 100644 index 00000000..109a8634 --- /dev/null +++ b/app/views/auth/keycloak-not-recognised.html @@ -0,0 +1,20 @@ +{% extends '_layouts/keycloak.html' %} + +{% set pageName = "Sign in" %} + + +{% block content %} +
+
+ +

You’re not a user of the service

+ +

Your email address {{ data.email }} is not associated with an account on Record a vaccination.

+ +

If you have not previously used the service, ask a colleague at your organisation to add you as user.

+ +

If you have used the service, log in using the account you used before.

+ +
+
+{% endblock %} diff --git a/app/views/auth/log-in-radios.html b/app/views/auth/log-in-radios.html new file mode 100644 index 00000000..3b52ede3 --- /dev/null +++ b/app/views/auth/log-in-radios.html @@ -0,0 +1,52 @@ +{% extends 'layout.html' %} + +{% set pageName = "Sign in" %} + +{% block content %} +
+
+ + +
+ + {{ radios({ + fieldset: { + legend: { + text: "How do you want to log in?", + size: "l", + isPageHeading: true + } + }, + items: [ + { + text: "Okta" + }, + { + divider: "or" + }, + { + text: "MediCare" + }, + { + text: "PharmaPMR" + }, + { + text: "PharmacyPlus+" + }, + { + text: "Phoenix" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + + +
+ +
+
+ +{% endblock %} diff --git a/app/views/auth/log-in.html b/app/views/auth/log-in.html new file mode 100644 index 00000000..03fc430a --- /dev/null +++ b/app/views/auth/log-in.html @@ -0,0 +1,53 @@ +{% extends 'layout.html' %} + +{% set pageName = "Log in" %} + +{% block content %} +
+
+ +

Log in

+ + {{ button({ + text: "Log in with Okta", + classes: "app-button--min-width-2", + href: "/auth/okta-sign-in" + }) }} + +

or

+ +
+ {{ button({ + text: "Log in with MediCare", + classes: "nhsuk-button--secondary app-button--min-width-2", + href: "/auth/medicare-sign-in" + }) }} +
+ +
+ {{ button({ + text: "Log in with PharmaPMR", + classes: "nhsuk-button--secondary app-button--min-width-2" + }) }} +
+ +
+ {{ button({ + text: "Log in with PharmacyPlus+", + classes: "nhsuk-button--secondary app-button--min-width-2" + }) }} +
+ +
+ {{ button({ + text: "Log in with Phoenix", + classes: "nhsuk-button--secondary app-button--min-width-2" + }) }} +
+ + + +
+
+ +{% endblock %} diff --git a/app/views/auth/medicare-authorise.html b/app/views/auth/medicare-authorise.html new file mode 100644 index 00000000..209ff5c5 --- /dev/null +++ b/app/views/auth/medicare-authorise.html @@ -0,0 +1,111 @@ +{% extends 'layout.html' %} + +{% set pageName = "Sign in" %} + + +{% block header %} +
+
+ + MediCare +
+
+{% endblock %} + +{% block footer %} +{% endblock %} + + +{% block content %} + + +
+ + +

NHS Record a vaccination would like to connect your account

+ +

If you grant access, the application will be able to access your email address and account ID.

+ + +
+ +
+ +
+ +
+ + + +
+ + +{% endblock %} diff --git a/app/views/auth/medicare-sign-in.html b/app/views/auth/medicare-sign-in.html new file mode 100644 index 00000000..479a431b --- /dev/null +++ b/app/views/auth/medicare-sign-in.html @@ -0,0 +1,121 @@ +{% extends 'layout.html' %} + +{% set pageName = "Sign in" %} + + +{% block header %} +
+
+ + MediCare +
+
+{% endblock %} + +{% block footer %} +{% endblock %} + + +{% block content %} + + +
+ +
+ +

Sign in with your MediCare account

+ +
+ + +
+ +
+ + +
+ + + +
+ +
+ + + + +
+

Testing area

+

Log in as:

+ + +
+ + + +{% endblock %} diff --git a/app/views/auth/medicare-unauthorised.html b/app/views/auth/medicare-unauthorised.html new file mode 100644 index 00000000..f7e382f8 --- /dev/null +++ b/app/views/auth/medicare-unauthorised.html @@ -0,0 +1,101 @@ +{% extends 'layout.html' %} + +{% set pageName = "Sign in" %} + + +{% block header %} +
+
+ + MediCare +
+
+{% endblock %} + +{% block footer %} +{% endblock %} + + +{% block content %} + + +
+ +

You have denied access to NHS Record a vaccination

+ +

If you change your mind, go to Settings.

+ + + +
+ + +{% endblock %} diff --git a/app/views/includes/header.html b/app/views/includes/header.html index af2c9c64..7b92876d 100644 --- a/app/views/includes/header.html +++ b/app/views/includes/header.html @@ -129,7 +129,7 @@ text: 'Log out' } if data.currentUserId, { - href: "/auth/okta-sign-in", + href: "/auth/log-in", text: "Log in" } if not data.currentUserId ] diff --git a/app/views/product-page.html b/app/views/product-page.html index fd1345f1..28995b08 100644 --- a/app/views/product-page.html +++ b/app/views/product-page.html @@ -21,7 +21,7 @@

The simplest way to record v classes: "nhsuk-button--reverse" }) }} -

or log in

+

or log in