From 5c664245167a9359ad9692109fadd3872d7652d7 Mon Sep 17 00:00:00 2001
From: Dessalines <tyhou13@gmx.com>
Date: Thu, 11 Feb 2021 13:52:26 -0500
Subject: [PATCH] Always show password reset link. Fixes #176

---
 src/assets/css/main.css         |  4 ++++
 src/shared/components/login.tsx | 18 +++++++++---------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/assets/css/main.css b/src/assets/css/main.css
index 115ad2b..349d81c 100644
--- a/src/assets/css/main.css
+++ b/src/assets/css/main.css
@@ -11,6 +11,10 @@
   cursor: pointer;
 }
 
+.pointer-events {
+  pointer-events: auto !important;
+}
+
 .no-click {
   pointer-events:none;
   opacity: 0.65;
diff --git a/src/shared/components/login.tsx b/src/shared/components/login.tsx
index 7006ae7..f772f04 100644
--- a/src/shared/components/login.tsx
+++ b/src/shared/components/login.tsx
@@ -134,15 +134,15 @@ export class Login extends Component<any, State> {
                 class="form-control"
                 required
               />
-              {validEmail(this.state.loginForm.username_or_email) && (
-                <button
-                  type="button"
-                  onClick={linkEvent(this, this.handlePasswordReset)}
-                  className="btn p-0 btn-link d-inline-block float-right text-muted small font-weight-bold"
-                >
-                  {i18n.t('forgot_password')}
-                </button>
-              )}
+              <button
+                type="button"
+                onClick={linkEvent(this, this.handlePasswordReset)}
+                className="btn p-0 btn-link d-inline-block float-right text-muted small font-weight-bold pointer-events"
+                disabled={!validEmail(this.state.loginForm.username_or_email)}
+                title={i18n.t('no_password_reset')}
+              >
+                {i18n.t('forgot_password')}
+              </button>
             </div>
           </div>
           <div class="form-group row">
-- 
2.44.1