<commit_before>import React, { Component } from 'react';
import { login, logout } from '../reducers/auth';
import {connect} from 'react-redux';
import Home from '../components/Home';
import LoginComponent from '../components/LoginComponent'

export class LoginContainer extends Component {

  constructor(props){
    super(props);
    this.state = {
      user: this.props.user,
      email: '',
      password: ''
    };
    this.updateEmail = this.updateEmail.bind(this);
    this.updatePassword = this.updatePassword.bind(this);
    this.doLogin = this.doLogin.bind(this);
    this.doLogout = this.doLogout.bind(this);
  }

  updateEmail(text){
    this.setState({ email: text });
  }

  updatePassword(text){
    this.setState({ password: text });
  }

  doLogin() {
    this.props.login(this.state.email, this.state.password);
  }

  render() {
    if (!this.props.user){
      return (
        <LoginComponent updateEmail={this.updateEmail} updatePassword={this.updatePassword} doLogin={this.doLogin} doLogout={this.doLogout} />
      );
    } else {
      return (
        <Home />
      );
    }
  }
}

export default connect(
  ({ auth }) => ({ user: auth }),
  { login, logout }
)(LoginContainer)<commit_msg>login working feedback pending<commit_after>import React, { Component } from 'react';
import { login, logout } from '../reducers/auth';
import {connect} from 'react-redux';
import Home from '../components/Home';
import LoginComponent from '../components/LoginComponent'

export class LoginContainer extends Component {

  constructor(props){
    super(props);
    this.state = {
      user: this.props.user,
      email: '',
      password: ''
    };
    this.updateEmail = this.updateEmail.bind(this);
    this.updatePassword = this.updatePassword.bind(this);
    this.doLogin = this.doLogin.bind(this);
    this.doLogout = this.doLogout.bind(this);
  }

  updateEmail(text){
    this.setState({ email: text });
  }

  updatePassword(text){
    this.setState({ password: <PASSWORD> });
  }

  doLogin() {
    this.props.login(this.state.email, this.state.password);
  }

  doLogout() {
    this.props.logout();
  }

  render() {
    if (!this.props.user){
      return (
        <LoginComponent updateEmail={this.updateEmail} updatePassword={this.updatePassword} doLogin={this.doLogin} doLogout={this.doLogout} />
      );
    } else {
      return (
        <Home />
      );
    }
  }
}

export default connect(
  ({ auth }) => ({ user: auth }),
  { login, logout }
)(LoginContainer)
{'fraction_non_alphanumeric': 0.15375399361022365, 'fraction_numerical': 0.0, 'mean_word_length': 3.073170731707317, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3625114', 'n_tokens_mistral': 781, 'n_tokens_neox': 772, 'n_words': 152}