Адрес электронной почты плохо отформатирован реагировать

const {email, password} = this.state;
    this.setState({ error: '', loading: true });
    firebase.auth().signInWithEmailAndPassword(email.trim(), password)
        .then(this.onLoginSuccess.bind(this))
        .catch( (err) => {
            firebase.auth().createUserWithEmailAndPassword(email.trim(), password)
                .then(this.onLoginSuccess.bind(this))
                .catch(this.onLoginFailed.bind(this));
        });
Talented Tiger