Explorar o código

switch passwordResetEnabled

kaori %!s(int64=4) %!d(string=hai) anos
pai
achega
a77fee26a6
Modificáronse 1 ficheiros con 10 adicións e 3 borrados
  1. 10 3
      src/client/js/components/LoginForm.jsx

+ 10 - 3
src/client/js/components/LoginForm.jsx

@@ -14,6 +14,7 @@ class LoginForm extends React.Component {
 
     this.state = {
       isRegistering: false,
+      isPasswordResetEnabled: false,
     };
 
     this.switchForm = this.switchForm.bind(this);
@@ -29,6 +30,10 @@ class LoginForm extends React.Component {
     }
   }
 
+  componentDidMount() {
+    this.setState({ isPasswordResetEnabled: true });
+  }
+
   switchForm() {
     this.setState({ isRegistering: !this.state.isRegistering });
   }
@@ -268,9 +273,11 @@ class LoginForm extends React.Component {
                 {isRegistrationEnabled && (
                 <div className="row">
                   <div className="col-12 text-right py-2">
-                    <a href="/forgot-password" className="d-block link-switch mb-1">
-                      <i className="icon-key"></i> {t('forgot_password')}
-                    </a>
+                    {this.state.isPasswordResetEnable && (
+                      <a href="/forgot-password" className="d-block link-switch mb-1">
+                        <i className="icon-key"></i> {t('forgot_password')}
+                      </a>
+                    )}
                     <a href="#register" id="register" className="link-switch" onClick={this.switchForm}>
                       <i className="ti-check-box"></i> {t('Sign up is here')}
                     </a>