From d41627b04b257464b7f0ba7afe481bef0c60b51e Mon Sep 17 00:00:00 2001
From: Fredrik Jonsson <frjo@xdeb.org>
Date: Wed, 15 Jun 2022 12:08:29 +0200
Subject: [PATCH] More 2FA button fixes.

---
 .../templates/two_factor/_wizard_actions.html     |  6 +++---
 hypha/apply/users/templates/users/login.html      |  2 +-
 .../src/sass/public/components/_link.scss         | 15 +++++++++++++++
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/hypha/apply/users/templates/two_factor/_wizard_actions.html b/hypha/apply/users/templates/two_factor/_wizard_actions.html
index 56384e454..ff5a768b9 100644
--- a/hypha/apply/users/templates/two_factor/_wizard_actions.html
+++ b/hypha/apply/users/templates/two_factor/_wizard_actions.html
@@ -2,10 +2,10 @@
 
 {% if wizard.steps.current == 'token' %}
     {% trans "Login" as button_text %}
-{% elif wizard.steps.current == 'welcome' %}
-    {% trans "Next" as button_text %}
-{% else %}
+{% elif wizard.steps.current == 'generator' %}
     {% trans "Enable Two-Factor Authentication" as button_text %}
+{% else %}
+    {% trans "Next" as button_text %}
 {% endif %}
 
 <button type="submit" class="button button--primary">{{ button_text }}</button>
diff --git a/hypha/apply/users/templates/users/login.html b/hypha/apply/users/templates/users/login.html
index be26db3d2..da278a5d0 100644
--- a/hypha/apply/users/templates/users/login.html
+++ b/hypha/apply/users/templates/users/login.html
@@ -59,7 +59,7 @@
             <p>{% trans "As a last resort, you can use a backup token:" %}</p>
             <p>
                 <button name="wizard_goto_step" type="submit" value="backup"
-                                class="btn btn-default btn-block">{% trans "Use Backup Token" %}</button>
+                                class="link link--button link--button-white link--button-white--narrow">{% trans "Use Backup Token" %}</button>
             </p>
         {% endif %}
 
diff --git a/hypha/static_src/src/sass/public/components/_link.scss b/hypha/static_src/src/sass/public/components/_link.scss
index 95288fd06..113be555b 100644
--- a/hypha/static_src/src/sass/public/components/_link.scss
+++ b/hypha/static_src/src/sass/public/components/_link.scss
@@ -53,6 +53,21 @@
         }
     }
 
+    &--button-white {
+        @include button(transparent, $color--black);
+        color: $color--black;
+        border-color: $color--black;
+
+        &:focus,
+        &:hover {
+            color: $color--white;
+        }
+
+        &--narrow {
+            @include button--narrow;
+        }
+    }
+
     &--button-long-text {
         padding: 10px;
 
-- 
GitLab