From 365477ff99215212c9b675dbd96677749d02f872 Mon Sep 17 00:00:00 2001
From: Dennis ASAMOAH <dennis.asamoah@unimfk277f9ty.home>
Date: Mon, 16 Dec 2024 23:15:18 +0100
Subject: [PATCH] improve longin template

---
 smash/web/templates/two_factor/core/login.html | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/smash/web/templates/two_factor/core/login.html b/smash/web/templates/two_factor/core/login.html
index 7b69dbad..4ea96057 100644
--- a/smash/web/templates/two_factor/core/login.html
+++ b/smash/web/templates/two_factor/core/login.html
@@ -11,6 +11,12 @@
         {% elif device.method == 'sms' %}
             <p class="login-box-msg">{% blocktrans %}We sent you a text message, please enter the tokens we
                 sent.{% endblocktrans %}</p>
+        {% elif device.public_id %}
+            <p class="login-box-msg">{% blocktrans %}Please insert your YubiKey and touch it to authenticate.
+                {% endblocktrans %}</p>
+        {% elif device.public_key %}
+            <p class="login-box-msg">{% blocktrans %}Please verify your identity using your security key or biometric device.
+                {% endblocktrans %}</p>
         {% else %}
             <p class="login-box-msg">{% blocktrans %}Please enter the tokens generated by your token
                 generator.{% endblocktrans %}</p>
@@ -28,13 +34,15 @@
         <div style="margin-left: -9999px"><input type="submit" value=""/></div>
 
         {% if other_devices %}
-            <p>{% trans "Or, alternatively, use one of your backup phones:" %}</p>
+                <p>{% trans "Or, alternatively, use one of your backup phones:" %}</p>
             <p>
                 {% for other in other_devices %}
-                    <button name="challenge_device" value="{{ other.persistent_id }}"
-                            class="btn btn-default btn-block" type="submit">
-                        {{ other|as_action }}
-                    </button>
+                    {% if other.method == 'call' or other.method == 'sms' %}
+                        <button name="challenge_device" value="{{ other.persistent_id }}"
+                                class="btn btn-default btn-block" type="submit">
+                            {{ other|as_action }}
+                        </button>
+                    {% endif %}
                 {% endfor %}</p>
         {% endif %}
         {% if backup_tokens %}
-- 
GitLab