<commit_before>import React, { PropTypes } from 'react';
import withProps from 'recompose/withProps';
import { Route } from 'react-router';
import FormTypes from './FormTypes';

const DefaultContainer = ({ children }) => children;

const onEnter = accounts => async (nextState, replace, callback) => {
  try {
    await accounts.resumeSession();
    if (accounts.user()) {
      replace(accounts.options().homePath);
    }
    callback();
  } catch (err) {
    callback();
  }
};

const accountRoutes = ({
  accounts,
  component,
  container = DefaultContainer,
}) => {
  const Component = component;
  const Container = container;
  return (
    <Route onEnter={onEnter(accounts)}>
      <Route
        path={accounts.options().loginPath}
        component={
          () =>
            <Container>
              {withProps({
                formType: FormTypes.LOGIN,
                accounts,
              })(Component)()}
            </Container>
        }
      />
      <Route
        path={accounts.options().signUpPath}
        component={
          () =>
            <Container>
              {withProps({
                formType: FormTypes.SIGNUP,
                accounts,
              })(Component)()}
            </Container>
        }
      />
    </Route>
  );
};

accountRoutes.propTypes = {
  accounts: PropTypes.object,<commit_msg>Add missing routes<commit_after>import React, { PropTypes } from 'react';
import withProps from 'recompose/withProps';
import { Route } from 'react-router';
import FormTypes from './FormTypes';

const DefaultContainer = ({ children }) => children;

const onEnter = accounts => async (nextState, replace, callback) => {
  try {
    await accounts.resumeSession();
    if (accounts.user()) {
      replace(accounts.options().homePath);
    }
    callback();
  } catch (err) {
    callback();
  }
};

const accountRoutes = ({
  accounts,
  component,
  container = DefaultContainer,
}) => {
  const Component = component;
  const Container = container;
  return (
    <Route onEnter={onEnter(accounts)}>
      <Route
        path={accounts.options().loginPath}
        component={
          () =>
            <Container>
              {withProps({
                formType: FormTypes.LOGIN,
                accounts,
              })(Component)()}
            </Container>
        }
      />
      <Route
        path={accounts.options().signUpPath}
        component={
          () =>
            <Container>
              {withProps({
                formType: FormTypes.SIGNUP,
                accounts,
              })(Component)()}
            </Container>
        }
      />
      <Route
        path={accounts.options().forgotPasswordPath}
        component={
          () =>
            <Container>
              {withProps({
                formType: FormTypes.FORGOT_PASSWORD,
                accounts,
              })(Component)()}
            </Container>
        }
      />
      <Route
        path={accounts.options().resetPasswordPath}
        component={
          () =>
            <Container>
              {withProps({
                formType: FormTypes.RESET_PASSWORD,
                accounts,
              })(Component)()}
            </Container>
        }
      />
    </Route>
  );
};

accountRoutes.propTypes = {
  accounts: PropTypes.object,
{'fraction_non_alphanumeric': 0.1318086066807102, 'fraction_numerical': 0.0, 'mean_word_length': 1.7358024691358025, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 39, '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': '3934565', 'n_tokens_mistral': 888, 'n_tokens_neox': 895, 'n_words': 175}