diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-07-25 09:16:52 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-07-25 09:16:52 -0300 |
| commit | 843f74f5c4be4ff57f6eb9b69949f6147509901b (patch) | |
| tree | a9224d3ce3214cfd2f7b7f9cafa5adb72f3e5f49 /app/components | |
| parent | 97d4e00d1a83462c46ef7347efffc7b1c2109d62 (diff) | |
| parent | 58909f19bb5480377e4130ef69c3affcc7cda118 (diff) | |
| download | mullvadvpn-843f74f5c4be4ff57f6eb9b69949f6147509901b.tar.xz mullvadvpn-843f74f5c4be4ff57f6eb9b69949f6147509901b.zip | |
Merge branch 'ignore-accounts-with-less-than-ten-digits'
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Login.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/components/Login.js b/app/components/Login.js index e1a11d2071..d902bba1bc 100644 --- a/app/components/Login.js +++ b/app/components/Login.js @@ -31,6 +31,8 @@ type State = { isActive: boolean, }; +const MIN_ACCOUNT_TOKEN_LENGTH = 10; + export default class Login extends Component<Props, State> { state = { isActive: true, @@ -182,7 +184,7 @@ export default class Login extends Component<Props, State> { _onLogin = () => { const accountToken = this.props.accountToken; - if (accountToken && accountToken.length > 0) { + if (accountToken && accountToken.length >= MIN_ACCOUNT_TOKEN_LENGTH) { this.props.login(accountToken); } }; @@ -278,7 +280,7 @@ export default class Login extends Component<Props, State> { const { accountToken, loginState } = this.props; const classes = [styles.input_arrow]; - if (accountToken && accountToken.length > 0) { + if (accountToken && accountToken.length >= MIN_ACCOUNT_TOKEN_LENGTH) { classes.push(styles.input_arrow__active); } @@ -291,7 +293,7 @@ export default class Login extends Component<Props, State> { _shouldActivateLoginButton() { const { accountToken } = this.props; - return accountToken && accountToken.length > 0; + return accountToken && accountToken.length >= MIN_ACCOUNT_TOKEN_LENGTH; } _shouldEnableAccountInput() { |
