confirmPasswordReset = (dispatch, firebase, code, password) => {
  dispatchLoginError(dispatch, null)
  return firebase
    .auth()
    .confirmPasswordReset(code, password)
    .catch((err) => {
      if (err) {
        switch (err.code) {
          case 'auth/expired-action-code':
            dispatchLoginError(
              dispatch,
              new Error('The action code has expired.')
            )
            break
          case 'auth/invalid-action-code':
            dispatchLoginError(
              dispatch,
              new Error('The action code is invalid.')
            )
            break
          case 'auth/user-disabled':
            dispatchLoginError(dispatch, new Error('The user is disabled.'))
            break
          case 'auth/user-not-found':
            dispatchLoginError(dispatch, new Error('The user is not found.'))
            break
          case 'auth/weak-password':
            dispatchLoginError(
              dispatch,
              new Error('The password is not strong enough.')
            )
            break
          default:
            dispatchLoginError(dispatch, err)
        }
        return Promise.reject(err)
      }
    })
}
Confirm the password reset with code and password
@param {Function} dispatch - Action dispatch function
@param {object} firebase - Internal firebase object
@param {string} code - Email confirmation reset code
@param {string} password - Password to set it to
@returns {Promise} Resvoles after password reset is confirmed
@private