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..c04abcbb --- /dev/null +++ b/app/views/auth/keycloak-existing-account-new-login.html @@ -0,0 +1,50 @@ +{% extends '_layouts/keycloak.html' %} + +{% set pageName = "Sign in" %} + + +{% block content %} +
You previously logged in with Okta.
+ +If you want to log in with PharmaPMR, you need to log in with Okta first.
+We will then link both Okta and PharmaPMR to your account, and in future, you can log in either way.
+ + {{ button({ + text: "Log in with Okta", + classes: "app-button--min-width-2", + href: "/auth/okta-sign-in" + }) }} + +There is no RAVS account for {{ data.email }}.
+ +If you’ve previously used RAVS, try logging in with the option you used last time.
+ +If you've never used RAVS before, you'll need an account before you can log in. Check with colleagues that you've been added to RAVS.
+ +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