Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Im unable to ping feathers server from react native. #537

Closed
jpca999 opened this Issue Jun 30, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@jpca999
Copy link

jpca999 commented Jun 30, 2017

image

ERROR
12:02:42 PM
{
  "line": 97280,
  "column": 24,
  "sourceURL": "http://packager.ub-4yw.libertytrust.jobs-x-15.exp.direct:80/main.bundle?platform=ios&dev=true&strict=false&minify=false&hot=true&assetPlugin=expo/tools/hashAssetFiles",
  "config": {
    "transformRequest": {},
    "transformResponse": {},
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "Content-Type": "application/json;charset=utf-8"
    },
    "method": "post",
    "url": "http://localhost:3030/authentication",
    "data": "{\"email\":\"liberty@gmail.com\",\"password\":\"password\",\"strategy\":\"local\"}"
  },
  "request": {
    "UNSENT": 0,
    "OPENED": 1,
    "HEADERS_RECEIVED": 2,
    "LOADING": 3,
    "DONE": 4,
    "readyState": 4,
    "status": 0,
    "timeout": 0,
    "withCredentials": false,
    "upload": {},
    "_aborted": false,
    "_hasError": true,
    "_method": "POST",
    "_response": "Could not connect to the server.",
    "_url": "http://localhost:3030/authentication",
    "_timedOut": false,
    "_trackingName": "unknown",
    "_incrementalEvents": false,
    "_requestId": null,
    "_headers": {
      "accept": "application/json, text/plain, */*",
      "content-type": "application/json;charset=utf-8"
    },
    "_responseType": "",
    "_sent": true,
    "_lowerCaseResponseHeaders": {},
    "_subscriptions": []
  }
}
export * from './auth_actions';
export * from './job_actions';

import axios from 'axios';

// const ROOT_URL = 'http://localhost:3030/';

const ROOT_URL = 'http://localhost:3030';

export function signinUser({email, password}) {
  console.log('9- calling the signinUser inside the actions file');
  // redux thunk gives us access to the Dispatch
  return function (dispatch) {
                                        // { email: email, password: password }
    // axios.post( `${ROOT_URL}/authentication`, {email,password, strategy: 'local'} )

    axios.post( `${ROOT_URL}/authentication`, {email: email, password:password, strategy: 'local'})
    .then(response => {
        console.log('it worked');
        console.log(response);
    }).catch(err => {
        console.log('ERROR');
        console.log(err);
    });


    // dispatch({ type: })
    // submit email password to server

    // if reqeust is good, we'll update the state to indicate user is authetnicated.


    // save the JWT token

    // redirect to route/feature  navigate 'mAp'


    //  if error : show errror

  }
}




//

Steps to reproduce

(First please check that this issue is not already solved as described
here
)

  • Tell us what broke. The more detailed the better.
  • If you can, please create a simple example that reproduces the issue and link to a gist, jsbin, repo, etc.

Expected behavior

Tell us what should happen

Actual behavior

Tell us what happens instead

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):

NodeJS version:

Operating System:

Browser Version:

React Native Version:

Module Loader:

@marshallswain

This comment has been minimized.

Copy link
Member

marshallswain commented Jun 30, 2017

@jpca999 the request is being made to "_url": "http://localhost:3030/authentication",.

Is the Feathers server on the same machine as http://packager.ub-4yw.libertytrust.jobs-x-15.exp.direct:80
???

@daffl daffl closed this Jul 4, 2017

@jpca999

This comment has been minimized.

Copy link
Author

jpca999 commented Jul 4, 2017

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Jul 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.