Login form: disallow connecting to HTTP addresses in production.

master
Tom Hacohen 7 years ago
parent 3231131e7e
commit ce2c89aa50

@ -73,9 +73,18 @@ class LoginForm extends React.Component {
if (!encryptionPassword) {
errors.errorEncryptionPassword = fieldRequired;
}
if (process.env.NODE_ENV !== 'development') {
if (this.state.showAdvanced && !this.state.server.startsWith('https://')) {
errors.errorServer = 'Server URI must start with https://';
}
}
if (Object.keys(errors).length) {
this.setState({errors: errors});
return;
} else {
this.setState({errors: {}});
}
this.props.onSubmit(username, password, encryptionPassword, server);

Loading…
Cancel
Save