<commit_before>// src/actions/users/sign-up.js
import API from '../../middleware/api'
import { USER_SIGNED_UP } from '../types'

const api = new API()
const users = api.service('users')

export default (user) => {
  return (dispatch) => {
    users.create(user)
    .then((res) => {
      dispatch({ type: USER_SIGNED_UP })
    })
    .catch((err) => {
      console.error(err)
    })
  }
}<commit_msg>automatically sign in when signing up<commit_after>// src/actions/users/sign-up.js
import API from '../../middleware/api'
import { USER_SIGNED_UP } from '../types'
import signIn from './sign-in'

const api = new API()
const users = api.service('users')

export default (user) => {
  return (dispatch) => {
    users.create(user)
    .then((res) => {
      dispatch({ type: USER_SIGNED_UP })
      dispatch(signIn(user))
    })
    .catch((err) => {
      console.error(err)
    })
  }
}
{'fraction_non_alphanumeric': 0.18130630630630631, 'fraction_numerical': 0.0, 'mean_word_length': 2.865217391304348, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4098829', 'n_tokens_mistral': 304, 'n_tokens_neox': 304, 'n_words': 68}