Thuzi / facebook-node-sdk

Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).
Other
737 stars 250 forks source link

Validation failed #117

Open nishantt12 opened 8 years ago

nishantt12 commented 8 years ago

Receiving validation failed at:

FB.setAccessToken(accessToken); FB.api('/me', function (data) { if (data && data.error) { if (data.error.code === 'TIMEDOUT') { return Errors.errorCustom(res, 'FACEBOOK TOKEN TIMEOUT'); } else { return Errors.errorCustom(res, data.error); } } else {

}

}); }

Error: { [ValidationError: User validation message: 'User validation failed', name: 'ValidationError',
errors:
{ name:
{ [ValidatorError: Path name message: 'Path name is req name: 'ValidatorError',
properties: [Object],
kind: 'required',
path: 'name',
value: undefined } } }
{ [ValidationError: User validation message: 'User validation failed', name: 'ValidationError',
errors:
{ name:
{ [ValidatorError: Path name message: 'Path name is req name: 'ValidatorError',
properties: [Object],
kind: 'required',
path: 'name',
value: undefined } } }

Even though /me API is working fine at the client side. Any specify reason why I am receiving validation failed?

dantman commented 8 years ago

Also, you should update; The 0.7.x are obsolete and the Thuzi repo is unmaintained.

nishantt12 commented 8 years ago

I have added appId and Secret on the client side.

nishantt12 commented 8 years ago

Stack trace:

{ [ValidationError: User validation failed]
message: 'User validation failed',
name: 'ValidationError',
errors:
{ name:
{ [ValidatorError: Path name is required.]
message: 'Path name is required.',
name: 'ValidatorError',
properties: [Object],
kind: 'required',
path: 'name',
value: undefined } } }
{ [ValidationError: User validation failed]
message: 'User validation failed',
name: 'ValidationError',
errors:
{ name:
{ [ValidatorError: Path name is required.]
message: 'Path name is required.',
name: 'ValidatorError',
properties: [Object],
kind: 'required',
path: 'name',
value: undefined } } }

dantman commented 8 years ago

I'm not asking about client side, Facebook's official client SDK has nothing to do with this node API library, configuring Facebook's SDK will not configure this library. You have to configure appId and the secret with FB.options.

You also should not be configuring your app secret client side, that is a security issue.

Additionally, that is not a stack trace. Stack traces have filenames and line numbers for the call stack at the point where the error was generated.