[FIX] totp (#131)

This commit is contained in:
Guilherme Gazzo 2017-12-06 13:07:14 -02:00 committed by GitHub
parent af5c3efbd2
commit b2ace37c99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 15 deletions

View File

@ -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>}