<commit_before>import React, { PropTypes } from 'react'
import { Navbar, Nav, NavItem, Modal, Button } from 'react-bootstrap'
import { actions, Control, Errors, Form } from 'react-redux-form'
import { LinkContainer } from 'react-router-bootstrap'

const Navigation = React.createClass({
  getInitialState () {
    return {show: false}
  },

  open () {
    this.setState({show: true})
  },

  close () {
    this.setState({show: false})
  },

  handleLogout () {
    this.props.logout()
  },

  onSubmit (values) {
    const { email, password } = values
    this.props.login(email, password)
      .then(action => {
        if (action.type === 'LOGIN_SUCCESS') {
          this.close()
        } else {
          this.props.dispatch(actions.setErrors('forms.loginCredentials', 'The email address or password that you\'ve entered is incorrect'))
        }
      })
  },

  render () {
    const user = this.props.account.user
    const loggedInButtons = (
      <Nav pullRight bsStyle='pills'>
        <NavItem eventKey={1} href='/user/{user.id}'>{user ? user.firstName : null}</NavItem>
        <NavItem eventKey={2} onClick={this.handleLogout}>Log out</NavItem>
      </Nav><commit_msg>Logout redirects to landing page - closes #89<commit_after>import React, { PropTypes } from 'react'
import { Navbar, Nav, NavItem, Modal, Button } from 'react-bootstrap'
import { actions, Control, Errors, Form } from 'react-redux-form'
import { LinkContainer } from 'react-router-bootstrap'
import { browserHistory } from 'react-router'

const Navigation = React.createClass({
  getInitialState () {
    return {show: false}
  },

  open () {
    this.setState({show: true})
  },

  close () {
    this.setState({show: false})
  },

  handleLogout () {
    this.props.logout()
    browserHistory.push('/')
  },

  onSubmit (values) {
    const { email, password } = values
    this.props.login(email, password)
      .then(action => {
        if (action.type === 'LOGIN_SUCCESS') {
          this.close()
        } else {
          this.props.dispatch(actions.setErrors('forms.loginCredentials', 'The email address or password that you\'ve entered is incorrect'))
        }
      })
  },

  render () {
    const user = this.props.account.user
    const loggedInButtons = (
      <Nav pullRight bsStyle='pills'>
        <NavItem eventKey={1} href='/user/{user.id}'>{user ? user.firstName : null}</NavItem>
        <NavItem eventKey={2} onClick={this.handleLogout}>Log out</NavItem>
      </Nav>
{'fraction_non_alphanumeric': 0.147118097541314, 'fraction_numerical': 0.0024183796856106408, 'mean_word_length': 3.009693053311793, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '7136351', 'n_tokens_mistral': 768, 'n_tokens_neox': 761, 'n_words': 176}