reloadAuth = (dispatch, firebase) => {
  dispatch({ type: actionTypes.AUTH_RELOAD_START })

  // reject and dispatch error if not logged in
  if (!firebase.auth().currentUser) {
    const error = new Error('User must be logged in to reload auth.')
    dispatch({ type: actionTypes.AUTH_RELOAD_ERROR, error })
    return Promise.reject(error)
  }

  return firebase
    .auth()
    .currentUser.reload()
    .then(() => {
      const auth = firebase.auth().currentUser
      dispatch({ type: actionTypes.AUTH_RELOAD_SUCCESS, payload: auth })
      return auth
    })
    .catch((error) => {
      dispatch({ type: actionTypes.AUTH_RELOAD_ERROR, error })
      return Promise.reject(error)
    })
}
Reload Auth state. Internally calls
`firebase.auth().currentUser.reload`.
@param {Function} dispatch - Action dispatch function
@param {object} firebase - Internal firebase object
@returns {Promise} Resolves with auth