Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/assets/sass/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 7 additions & 1 deletion app/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
14 changes: 14 additions & 0 deletions app/views/_layouts/keycloak.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "../layout.html" %}

{% block header %}
{{ header({
service: {
text: "RAVS Login"
}
}) }}
{% endblock %}

{% block footer %}
{{ footer({
}) }}
{% endblock %}
49 changes: 49 additions & 0 deletions app/views/auth/keycloak-existing-account-new-login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% extends '_layouts/keycloak.html' %}

{% set pageName = "Sign in" %}


{% block content %}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">

<h1 class="nhsuk-heading-l">You previously logged in a different way</h1>

<p>Your email address {{ data.email }} is associated with a different log in method.</p>

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

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

<div>
{{ button({
text: "Log in with PharmaPMR",
classes: "nhsuk-button--secondary app-button--min-width-2"
}) }}
</div>

<div>
{{ button({
text: "Log in with PharmacyPlus+",
classes: "nhsuk-button--secondary app-button--min-width-2"
}) }}
</div>

<div>
{{ button({
text: "Log in with Phoenix",
classes: "nhsuk-button--secondary app-button--min-width-2"
}) }}
</div>


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


</div>
</div>
{% endblock %}
20 changes: 20 additions & 0 deletions app/views/auth/keycloak-not-recognised.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends '_layouts/keycloak.html' %}

{% set pageName = "Sign in" %}


{% block content %}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">

<h1 class="nhsuk-heading-l">You’re not a user of the service</h1>

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

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

<p>If you have used the service, <a href="/auth/log-in">log in</a> using the account you used before.</p>

</div>
</div>
{% endblock %}
52 changes: 52 additions & 0 deletions app/views/auth/log-in-radios.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{% extends 'layout.html' %}

{% set pageName = "Sign in" %}

{% block content %}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">


<form action="/auth/log-in-answer" method="post">

{{ 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"
}) }}


</form>

</div>
</div>

{% endblock %}
53 changes: 53 additions & 0 deletions app/views/auth/log-in.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% extends 'layout.html' %}

{% set pageName = "Log in" %}

{% block content %}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">

<h1 class="nhsuk-heading-l nhsuk-u-margin-bottom-6">Log in</h1>

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

<p>or</p>

<div>
{{ button({
text: "Log in with MediCare",
classes: "nhsuk-button--secondary app-button--min-width-2",
href: "/auth/medicare-sign-in"
}) }}
</div>

<div>
{{ button({
text: "Log in with PharmaPMR",
classes: "nhsuk-button--secondary app-button--min-width-2"
}) }}
</div>

<div>
{{ button({
text: "Log in with PharmacyPlus+",
classes: "nhsuk-button--secondary app-button--min-width-2"
}) }}
</div>

<div>
{{ button({
text: "Log in with Phoenix",
classes: "nhsuk-button--secondary app-button--min-width-2"
}) }}
</div>



</div>
</div>

{% endblock %}
111 changes: 111 additions & 0 deletions app/views/auth/medicare-authorise.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{% extends 'layout.html' %}

{% set pageName = "Sign in" %}


{% block header %}
<header>
<div class="service-name">
<span class="logo">+</span>
MediCare
</div>
</header>
{% endblock %}

{% block footer %}
{% endblock %}


{% block content %}
<style>
* { box-sizing: border-box; }
html, body { background-color: cornsilk; }
body {
margin: 0; padding: 0;
}
header {
margin: 0; padding: 40px;
color: snow;
background-color: darkred;
}

h1, p {
max-width: 750px;
}

.logo {
font-size: 60px;
font-weight: bold;
line-height: 50px;
color: salmon;
}
.service-name {
font-size: 40px;
font-weight: bold;
}

label {
display: block;
font-size: 30px;
font-weight: bold;
margin-bottom: 5px;
}

input[type=text],
input[type=password] {
font-size: 18px;
padding: 5px;
border-radius: 0;
border: 2px solid black;
width: 400px;
}

.field {
margin-bottom: 40px;
}

button {
font-size: 30px;
padding: 10px;
border: 0px;
border-radius: 5px;
background-color: darkred;
color: snow;
margin-right: 40px;
}

.allow {
background-color: green;
}

.deny {
background-color: darkred;
}

form {
display: inline-block;
}
</style>

<main>


<h1>NHS Record a vaccination would like to connect your account</h1>

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


<form action="/auth/sign-in" method="post">
<button type="submit" class="allow">Allow</button>
</form>

<form action="/auth/medicare-unauthorised" method="post">
<button type="submit" class="deny">Deny</button>
</form>

</form>

</main>


{% endblock %}
Loading