code: function reducer(state = initialState, action) {
    switch (action.type) {
      case SET_TOKEN: {
        const token = action.payload;
        // const providers = null;
        // const oauth = {
        //     providers
        // }
        return {...state, token};
      }
  
      case SET_AUTHENTICATING: {
        const authenticating = action.payload;
        return {...state, authenticating};
      }
  
      case SET_ME: {
        const me = action.payload
        return {...state, me};
      }
  
      case REQUEST_INVALIDATE_TOKEN: {
        if (action.error) {
          return {...state, error: action.payload.error};
        }
        else {
          return {...state,  error:null };
        }
      }
  
      case REQUEST_OAUTH_PROVIDERS: {
        if (action.error) {
          return {...state, error: action.payload.error};
        }
        else {
          return {...state,  error:null };
        }
      }
  
      case SET_OAUTH_ENABLED: {
        const enabled = action.payload;
        const oauth = {
          ...state.oauth,
          enabled
        }
        return {...state, oauth};
      }
  
      case RECEIVE_OAUTH_PROVIDERS: {
        const providers = action.payload;
        const oauth = {
            ...state.oauth,
            providers
        }
        return {...state, oauth};
      }
  
      case RECEIVE_API_KEY: {
        const apiKey = action.payload;
        return {...state, apiKey};
      }
  
      case SHOW_LOGIN_OPTIONS: {
        const show = action.payload;
        const ui = {...state.ui};
        ui.showLoginOptions = show;
        return {...state, ui}
      }
  
      case SHOW_GIRDER_LOGIN: {
        const show = action.payload;
        const ui = {...state.ui};
        ui.girder = {show};
        return {...state, ui}
      }
  
      case SHOW_NERSC_LOGIN: {
        const show = action.payload;
        const ui = {...state.ui};
        ui.nersc = {show};
        return {...state, ui}
      }
  
      default:  {
        return state;
      }
    }
  }
docs: For some reason the reducer created by redux-actions' handleActions() doesn't seem to work. For the sake of time, implementing a plain reducer instead.