Skip to content

Commit 6fee319

Browse files
committed
Account and 2FA setup page
1 parent d97939d commit 6fee319

4 files changed

Lines changed: 51 additions & 49 deletions

File tree

hypha/apply/users/templates/two_factor/_base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{% endblock %}
2424

2525
{% block content %}
26-
<div class="max-w-2xl wrapper wrapper--inner-space-medium two-factor">
26+
<div class="my-8 mx-auto max-w-2xl">
2727
{% block content_inner %}{% endblock %}
2828
</div>
2929
{% endblock %}

hypha/apply/users/templates/two_factor/core/setup.html

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,53 @@
22
{% load i18n %}
33

44
{% block content_inner %}
5-
{% if wizard.steps.current == 'welcome' %}
6-
<p>{% blocktrans trimmed %}2FA is an extra layer of security used to make sure that people trying to gain access to an
7-
online account are who they say they are. We recommend using Authy or another
8-
authenticator app.{% endblocktrans %}</p>
9-
<p>{% blocktrans trimmed %}Please contact {{ ORG_EMAIL }} if you have technical difficulty
10-
enabling 2FA.{% endblocktrans %}</p>
11-
{% elif wizard.steps.current == 'method' %}
12-
<p>{% blocktrans trimmed %}Please select which authentication method you would
13-
like to use.{% endblocktrans %}</p>
14-
{% elif wizard.steps.current == 'generator' %}
15-
<p>{% blocktrans trimmed %}2FA requires a verification code to pair your smartphone with your account.
16-
{% endblocktrans %}</p>
17-
<p>{% blocktrans trimmed %}<strong>Step 1:</strong> Open the Authenticator app on your phone and scan the QR code displayed below.
18-
{% endblocktrans %}</p>
19-
<p><img src="{{ QR_URL }}" alt="QR Code" class="bg-white" width="200" height="200" /></p>
20-
<p style="font-size: small">{% trans "Unable to scan the QR code? Try this link:" %} <a href="{{ otpauth_url }}" title="2FA Setup URL">{{ otpauth_url }}</a></p>
21-
<p>{% blocktrans trimmed %}<strong>Step 2:</strong> Enter the 6-digit verification code generated by the app below.{% endblocktrans %}</p>
22-
{% elif wizard.steps.current == 'sms' %}
23-
<p>{% blocktrans trimmed %}Please enter the phone number you wish to receive the
24-
text messages on. This number will be validated in the next step.
25-
{% endblocktrans %}</p>
26-
{% elif wizard.steps.current == 'call' %}
27-
<p>{% blocktrans trimmed %}Please enter the phone number you wish to be called on.
28-
This number will be validated in the next step. {% endblocktrans %}</p>
29-
{% elif wizard.steps.current == 'validation' %}
30-
{% if challenge_succeeded %}
31-
{% if device.method == 'call' %}
32-
<p>{% blocktrans trimmed %}We are calling your phone right now, please enter the
33-
digits you hear.{% endblocktrans %}</p>
34-
{% elif device.method == 'sms' %}
35-
<p>{% blocktrans trimmed %}We sent you a text message, please enter the tokens we
36-
sent.{% endblocktrans %}</p>
5+
<div class="prose">
6+
{% if wizard.steps.current == 'welcome' %}
7+
<p>{% blocktrans trimmed %}2FA is an extra layer of security used to make sure that people trying to gain access to an
8+
online account are who they say they are. We recommend using Authy or another
9+
authenticator app.{% endblocktrans %}</p>
10+
<p class="text-sm text-fg-muted">{% blocktrans trimmed %}Please contact {{ ORG_EMAIL }} if you have technical difficulty
11+
enabling 2FA.{% endblocktrans %}</p>
12+
{% elif wizard.steps.current == 'method' %}
13+
<p>{% blocktrans trimmed %}Please select which authentication method you would
14+
like to use.{% endblocktrans %}</p>
15+
{% elif wizard.steps.current == 'generator' %}
16+
<p>{% blocktrans trimmed %}2FA requires a verification code to pair your smartphone with your account.
17+
{% endblocktrans %}</p>
18+
<p>{% blocktrans trimmed %}<strong>Step 1:</strong> Open the Authenticator app on your phone and scan the QR code displayed below.
19+
{% endblocktrans %}</p>
20+
<p><img src="{{ QR_URL }}" alt="QR Code" class="bg-white" width="200" height="200" /></p>
21+
<p style="font-size: small">{% trans "Unable to scan the QR code? Try this link:" %} <a href="{{ otpauth_url }}" title="2FA Setup URL">{{ otpauth_url }}</a></p>
22+
<p>{% blocktrans trimmed %}<strong>Step 2:</strong> Enter the 6-digit verification code generated by the app below.{% endblocktrans %}</p>
23+
{% elif wizard.steps.current == 'sms' %}
24+
<p>{% blocktrans trimmed %}Please enter the phone number you wish to receive the
25+
text messages on. This number will be validated in the next step.
26+
{% endblocktrans %}</p>
27+
{% elif wizard.steps.current == 'call' %}
28+
<p>{% blocktrans trimmed %}Please enter the phone number you wish to be called on.
29+
This number will be validated in the next step. {% endblocktrans %}</p>
30+
{% elif wizard.steps.current == 'validation' %}
31+
{% if challenge_succeeded %}
32+
{% if device.method == 'call' %}
33+
<p>{% blocktrans trimmed %}We are calling your phone right now, please enter the
34+
digits you hear.{% endblocktrans %}</p>
35+
{% elif device.method == 'sms' %}
36+
<p>{% blocktrans trimmed %}We sent you a text message, please enter the tokens we
37+
sent.{% endblocktrans %}</p>
38+
{% endif %}
39+
{% else %}
40+
<p class="alert alert-warning" role="alert">{% blocktrans trimmed %}We've
41+
encountered an issue with the selected authentication method. Please
42+
go back and verify that you entered your information correctly, try
43+
again, or use a different authentication method instead. If the issue
44+
persists, contact the site administrator.{% endblocktrans %}</p>
3745
{% endif %}
38-
{% else %}
39-
<p class="alert alert-warning" role="alert">{% blocktrans trimmed %}We've
40-
encountered an issue with the selected authentication method. Please
41-
go back and verify that you entered your information correctly, try
42-
again, or use a different authentication method instead. If the issue
43-
persists, contact the site administrator.{% endblocktrans %}</p>
46+
{% elif wizard.steps.current == 'yubikey' %}
47+
<p>{% blocktrans trimmed %}To identify and verify your YubiKey, please insert a
48+
token in the field below. Your YubiKey will be linked to your
49+
account.{% endblocktrans %}</p>
4450
{% endif %}
45-
{% elif wizard.steps.current == 'yubikey' %}
46-
<p>{% blocktrans trimmed %}To identify and verify your YubiKey, please insert a
47-
token in the field below. Your YubiKey will be linked to your
48-
account.{% endblocktrans %}</p>
49-
{% endif %}
50-
51+
</div>
5152
<form action="" method="post">{% csrf_token %}
5253
{% include "two_factor/_wizard_forms.html" %}
5354

hypha/apply/users/templates/users/account.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,27 @@ <h2 class="mb-4 card-title">{% trans "Account Security" %}</h2>
5959

6060
{% if show_change_password %}
6161
<div class="mb-8 block_manage_password">
62-
<h3 class="mb-0 text-base font-bold">{% trans "Password" %}</h3>
62+
<h3 class="mb-2 text-base font-bold">{% trans "Password" %}</h3>
6363
<p>
6464
{% if user.has_usable_password %}
65-
<a class="btn btn-primary" href="{% url 'users:password_change' %}">
65+
<a class="btn btn-secondary btn-outline" href="{% url 'users:password_change' %}">
66+
{% heroicon_micro "key" class="inline w-4 h-4" aria_hidden=true %}
6667
{% trans "Update password" %}
6768
</a>
6869
{% else %}
6970
<button class="btn btn-primary"
7071
hx-post="{% url 'users:set_user_password' %}"
7172
hx-swap="outerHTML transition:true"
7273
>
74+
{% heroicon_micro "key" class="inline w-4 h-4" aria_hidden=true %}
7375
{% trans "Set Password" %}
7476
</button>
7577
{% endif %}
7678
</p>
7779
</div>
7880
{% endif %}
7981

80-
<h3 class="mb-0 text-base font-bold">{% trans "Two-Factor Authentication (2FA)" %}</h2>
82+
<h3 class="mb-2 text-base font-bold">{% trans "Two-Factor Authentication (2FA)" %}</h3>
8183
<p class="card-actions">
8284
{% if default_device %}
8385
<a class="btn btn-primary" href="{% url 'users:backup_tokens' %}">{% trans "Backup codes" %}</a>

hypha/apply/users/templates/users/login.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{% load i18n wagtailcore_tags heroicons %}
33

44
{% block title %}{% trans "Log in" %}{% endblock %}
5-
{% block body_class %}bg-base-100{% endblock %}
65

76
{% block content %}
87
<div class="my-5 max-w-2xl">

0 commit comments

Comments
 (0)