From 3789a4613acd78df162601bda040075b20e92785 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Thu, 5 May 2016 23:07:59 -0400
Subject: Update MFA help text and fix some minor bugs (#2903)

---
 webapp/components/login/login.jsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'webapp/components/login/login.jsx')

diff --git a/webapp/components/login/login.jsx b/webapp/components/login/login.jsx
index ce200ad75..d2ee1be81 100644
--- a/webapp/components/login/login.jsx
+++ b/webapp/components/login/login.jsx
@@ -105,13 +105,12 @@ export default class Login extends React.Component {
     }
 
     submit(loginId, password, token) {
-        this.setState({showMfa: false, serverError: null});
-
         Client.webLogin(
             loginId,
             password,
             token,
             () => {
+                this.setState({serverError: null});
                 this.finishSignin();
             },
             (err) => {
@@ -122,6 +121,7 @@ export default class Login extends React.Component {
                     err.id === 'ent.ldap.do_login.user_not_registered.app_error' ||
                     err.id === 'ent.ldap.do_login.user_filtered.app_error') {
                     this.setState({
+                        showMfa: false,
                         serverError: (
                             <FormattedMessage
                                 id='login.userNotFound'
@@ -130,7 +130,7 @@ export default class Login extends React.Component {
                         )
                     });
                 } else {
-                    this.setState({serverError: err.message});
+                    this.setState({showMfa: false, serverError: err.message});
                 }
             }
         );
-- 
cgit v1.2.3-1-g7c22

