imports/ui/Login.js
//END This is needed in React Router 4 instead of onEnter
END This is needed in React Router 4 instead of onEnter
END This is needed in React Router 4 instead of onEnter
onSubmit(e) {
    e.preventDefault();
    let email = this.refs.email.value.trim();
    let password = this.refs.password.value.trim();
    Meteor.loginWithPassword({email}, password, (err) => {
      if (err) {
        this.setState({error: 'Unable to login. Check email and password.'});
      } else {
        this.setState({error: ''});
      }
    });
  }
onSubmit ( e ) { e . preventDefault ( ) ; let email = this . refs . email . value . trim ( ) ; let password = this . refs . password . value . trim ( ) ; Meteor . loginWithPassword ( { email } , password , ( err ) => { if ( err ) { this . setState ( { error : 'Unable to login. Check email and password.' } ) ; } else { this . setState ( { error : '' } ) ; } } ) ; }
END This is needed in React Router 4 instead of onEnter
END This is needed in React Router 4 instead of onEnter
//Shows error to screen