October 2017
Intermediate to advanced
302 pages
7h 27m
English
Let's get that signup process going. Again, it's a rather simple function name--firebase.auth().createUserWithEmailAndPassword(email, password). Again, it returns a promise. Let's add then and catch, but leave the then as a console log for now:
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.' }); });}
Try logging in to our app, and you should see a complicated user object show up in the console. Success! We created our first user account. If you try logging in again with the same account, you should see the same user object logged to the console.
You can try again ...
Read now
Unlock full access