Guest User

Untitled

a guest
Dec 10th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. onLogin = async () => {
  2. try {
  3. const response = await firebase.auth().signInWithEmailAndPassword(this.state.emailValue, this.state.passwordValue);
  4. console.log(response);
  5. this.setState({
  6. loggingIn: false,
  7. emailValue: '',
  8. passwordValue: '',
  9. hasError: false,
  10. error: '',
  11. });
  12. } catch (error) {
  13. console.log(error);
  14. this.setState({ loggingIn: false, error: error.toString(), hasError: true });
  15. }
  16. this.setState({
  17. loggingIn: false,
  18. });
  19. }
  20.  
  21. onChangeLogin = (e, type) => {
  22. this.setState({ [`${type}Value`]: e });
  23. }
Add Comment
Please, Sign In to add comment