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.
+ + + + + + + + +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 %} +
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" + }) }} + +We will then link both log in methods to your account and in future you can log in either way.
+ + +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.
+ +or
+ +If you grant access, the application will be able to access your email address and account ID.
+ + + + + + + + +Log in as:
+ + +If you change your mind, go to Settings.
+ + + +or log in
+or log in