Skip to content

Commit 9ef86e0

Browse files
authored
fix: make 2FA authentication code background darker (#111)
On darker themes it's impossible to scan the 2FA code. Make the background image of the QR code a gray tone to fix scanning for darker themes such as DaisyUI business.
1 parent 03af9b6 commit 9ef86e0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

allauth_ui/templates/mfa/totp/activate_form.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@
1010
{% translate "Activate" as button_text %}
1111
{% url 'mfa_activate_totp' as action_url %}
1212
{% #form form=form method="post" url=action_url button_text=button_text render_fields="false" %}
13-
<img src="{{ totp_svg_data_uri }}"
14-
alt="{{ form.secret }}"
15-
class="mx-auto my-5" />
13+
{# <div class="p-1 bg-gray-300 rounded"> #}
14+
<img class="py-3 px-5 mx-auto my-5 bg-gray-300 rounded"
15+
src="{{ totp_svg_data_uri }}"
16+
alt="{{ form.secret }}" />
17+
{# </div> #}
1618
{% #form_field field=form.code %}
1719
{% /form_field %}
1820
<div class="my-3">
1921
<label class="label" for="authenticator_secret">
2022
<span class="label-text">{% translate "Authenticator secret" %}</span>
2123
</label>
22-
<p class="text-xs mb-2">
24+
<p class="mb-2 text-xs">
2325
{% translate "You can store this secret and use it to reinstall your authenticator app at a later time." %}
2426
</p>
2527
<input type="text" id="authenticator_secret"" value="{{ form.secret }}" disabled

tests/settings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,10 @@
112112
ACCOUNT_AUTHENTICATION_METHOD = "email"
113113
ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 1000
114114

115-
ALLAUTH_UI_THEME = "light"
116-
117115
BASE_DIR = Path(__file__).parent.parent
118116

119117
USERSESSIONS_TRACK_ACTIVITY = True
120118

121119
MFA_SUPPORTED_TYPES = ["totp", "webauthn", "recovery_codes"]
122120
MFA_TOTP_ISSUER = "AllAuth UI"
121+
ALLAUTH_UI_THEME = "business"

0 commit comments

Comments
 (0)