October 2017
Intermediate to advanced
302 pages
7h 27m
English
Here, things will get a bit more tricky. First, we'll do some preparation.
Inside our LoginContainer, when it comes to our signup and login methods, we currently just console.log out the result in our then statement. In other words, we don't actually do anything once our user logs in:
signup() { firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password) .then(res => { console.log(res); }).catch(error => { console.log(error); this.setState({ error: 'Error signing up.' }); })}
Let's change this bit (in both signup and login) to call another method, onLogin:
login() { firebase.auth().signInWithEmailAndPassword(this.state.email, this.state.password) .then(res => { this.onLogin(); }).catch((error) ...Read now
Unlock full access