<commit_before>import { AUTH_SIGNED_IN, AUTH_SIGNED_OUT } from '../actionTypes/auth';

const signIn = (state = {}, action) => {
  switch (action.type) {
    case AUTH_SIGNED_IN: {
      return {
        username: action.data.username,
        fullName: action.data.full_name,
        loggedIn: action.data.logged_in,
        id: action.data.id,
      };
    }

    case AUTH_SIGNED_OUT: {
      return {
        id: '',
        username: '',
        fullName: '',
        loggedIn: false,
      };
    }

    default:
      return state;
  }
};

export default signIn;<commit_msg>Minor auth reducer rewrite and add new register case<commit_after>import { AUTH_SIGNED_IN, AUTH_SIGNED_OUT, AUTH_REGISTERED } from '../actionTypes/auth';

const defaultState = {
  id: '',
  username: '',
  fullName: '',
  loggedIn: false,
  registered: false,
};

const auth = (state = defaultState, action) => {
  switch (action.type) {
    case AUTH_SIGNED_IN: {
      return Object.assign({}, state, {
        username: action.data.username,
        fullName: action.data.full_name,
        loggedIn: action.data.logged_in,
        id: action.data.id,
      });
    }

    case AUTH_SIGNED_OUT: {
      return defaultState;
    }

    case AUTH_REGISTERED: {
      return Object.assign({}, state, {
        registered: true,
      });
    }

    default:
      return state;
  }
};

export default auth;
{'fraction_non_alphanumeric': 0.12626262626262627, 'fraction_numerical': 0.0, 'mean_word_length': 2.342168674698795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2458998', 'n_tokens_mistral': 451, 'n_tokens_neox': 447, 'n_words': 95}