Skip to content

Commit

Permalink
fix: make 2FA authentication code background darker
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
danihodovic committed Aug 8, 2024
1 parent 03af9b6 commit f9ef292
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 6 additions & 4 deletions allauth_ui/templates/mfa/totp/activate_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@
{% translate "Activate" as button_text %}
{% url 'mfa_activate_totp' as action_url %}
{% #form form=form method="post" url=action_url button_text=button_text render_fields="false" %}
<img src="{{ totp_svg_data_uri }}"
alt="{{ form.secret }}"
class="mx-auto my-5" />
{# <div class="p-1 bg-gray-300 rounded"> #}
<img class="py-3 px-5 mx-auto my-5 bg-gray-300 rounded"
src="{{ totp_svg_data_uri }}"
alt="{{ form.secret }}" />
{# </div> #}
{% #form_field field=form.code %}
{% /form_field %}
<div class="my-3">
<label class="label" for="authenticator_secret">
<span class="label-text">{% translate "Authenticator secret" %}</span>
</label>
<p class="text-xs mb-2">
<p class="mb-2 text-xs">
{% translate "You can store this secret and use it to reinstall your authenticator app at a later time." %}
</p>
<input type="text" id="authenticator_secret"" value="{{ form.secret }}" disabled
Expand Down
3 changes: 1 addition & 2 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,10 @@
ACCOUNT_AUTHENTICATION_METHOD = "email"
ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 1000

ALLAUTH_UI_THEME = "light"

BASE_DIR = Path(__file__).parent.parent

USERSESSIONS_TRACK_ACTIVITY = True

MFA_SUPPORTED_TYPES = ["totp", "webauthn", "recovery_codes"]
MFA_TOTP_ISSUER = "AllAuth UI"
ALLAUTH_UI_THEME = "business"

0 comments on commit f9ef292

Please sign in to comment.