client/src/pages/Login/index.js
// Listen for click for user login. Next create a userObjectLogin that contains the email, and password states from this page. Next, send this userObjectLogin to the route setup by the backend to interact with the database. Then, the user will be rerouted to the members page. Lastly, reset the state of the input boxes to empty.
Listen for click for user login. Next create a userObjectLogin that contains the email, and password states from this page. Next, send this userObjectLogin to the route setup by the backend to interact with the database. Then, the user will be rerouted to the members page. Lastly, reset the state of the input boxes to empty.
Listen for click for user login . Next create a userObjectLogin that contains the email and password states from this page . Next send this userObjectLogin to the route setup by the backend to interact with the database . Then the user will be rerouted to the members page . Lastly reset the state of the input boxes to empty .
userLogin(e) {
    e.preventDefault()
    var userObjectLogin = {
      email: this.state.emailLogin,
      password: this.state.passwordLogin
    };
    API.login(userObjectLogin).then(res => {
      console.log(res.data)
      this.setState({ redirect: true })
    })
      .catch(err => console.log(err));
    this.setState({ emailLogin: "", passwordLogin: "" })
  }
userLogin ( e ) { e . preventDefault ( ) var userObjectLogin = { email : this . state . emailLogin , password : this . state . passwordLogin } ; API . login ( userObjectLogin ) . then ( res => { console . log ( res . data ) this . setState ( { redirect : true } ) } ) . catch ( err => console . log ( err ) ) ; this . setState ( { emailLogin : "" , passwordLogin : "" } ) }
Listen for click for user login.
Listen for click for user login .