From b2ace37c99360869dd6d6d09e499ebe84af015ac Mon Sep 17 00:00:00 2001
From: Guilherme Gazzo <guilhermegazzo@gmail.com>
Date: Wed, 6 Dec 2017 13:07:14 -0200
Subject: [PATCH] [FIX] totp (#131)

---
 app/views/LoginView.js | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/app/views/LoginView.js b/app/views/LoginView.js
index 5928a448d..ccff7a763 100644
--- a/app/views/LoginView.js
+++ b/app/views/LoginView.js
@@ -62,22 +62,23 @@ class LoginView extends React.Component {
 	}
 
 	renderTOTP = () => {
-		if (!this.props.login.failure || this.props.login.error.error !== 'totp-required') {
-			return null;
+		if (/totp/ig.test(this.props.login.error.error)) {
+			return (
+				<TextInput
+					ref={ref => this.codeInput = ref}
+					style={styles.input_white}
+					onChangeText={code => this.setState({ code })}
+					keyboardType='numeric'
+					autoCorrect={false}
+					returnKeyType='done'
+					autoCapitalize='none'
+					onSubmitEditing={this.submit}
+					placeholder='Code'
+					underlineColorAndroid='transparent'
+				/>
+			);
 		}
-		return (
-			<TextInput
-				ref={ref => this.codeInput = ref}
-				style={styles.input_white}
-				onChangeText={code => this.setState({ code })}
-				keyboardType='numeric'
-				autoCorrect={false}
-				returnKeyType='done'
-				autoCapitalize='none'
-				onSubmitEditing={this.submit}
-				placeholder='Code'
-			/>
-		);
+		return null;
 	}
 
 	// {this.props.login.isFetching && <Text> LOGANDO</Text>}
-- 
GitLab