<commit_before>import React, { Component, PropTypes } from 'react'

import { connect } from 'react-redux'

import { loginSelector } from '../selectors/loginSelector'

import LoginForm from '../components/LoginForm'

import { login } from '../actions/user'
import { setModule } from '../actions/modules'

class Login extends Component {

  static fetchData(dispatch, params=null, clientSide=false) {
    // set module
    dispatch(setModule('user'))
  }
  
  componentDidMount() {
    this.constructor.fetchData(this.props.dispatch, null, true)
  }

  componentWillReceiveProps(nextProps) {
    // redirect if user is authenticated
    if (nextProps.user.is_authenticated) {
      // redirect to target page if we have a next<commit_msg>fix a bug in Login component's fetch data.<commit_after>import React, { Component, PropTypes } from 'react'

import { connect } from 'react-redux'

import { loginSelector } from '../selectors/loginSelector'

import LoginForm from '../components/LoginForm'

import { login } from '../actions/user'
import { setModule } from '../actions/modules'

class Login extends Component {

  static fetchData(dispatch, params=null, clientSide=false) {
    // set module
    dispatch(setModule('user'))
    // return empty promises array
    return []
  }
  
  componentDidMount() {
    this.constructor.fetchData(this.props.dispatch, null, true)
  }

  componentWillReceiveProps(nextProps) {
    // redirect if user is authenticated
    if (nextProps.user.is_authenticated) {
      // redirect to target page if we have a next
{'fraction_non_alphanumeric': 0.1135483870967742, 'fraction_numerical': 0.0, 'mean_word_length': 3.7, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2198176', 'n_tokens_mistral': 439, 'n_tokens_neox': 429, 'n_words': 127}