feathersjs-ecosystem / authentication

[MOVED] Feathers local, token, and OAuth authentication over REST and Websockets using JSON Web Tokens (JWT) with PassportJS.
MIT License
317 stars 118 forks source link

Quote Error #519

Closed jonathanroze closed 7 years ago

jonathanroze commented 7 years ago

Hi there,

I'm working on a project and i need to implemente a Facebook login but i've an issue!

When FeatherJS need to create a user into my database (Mysql with KnexJS) i've an error : "ER_WRONG_VALUE_COUNT_ON_ROW: Column count doesn't match value count at row 1"

After some research i know why ! When FeatherJs try to add a new user it doesn't add single quote around the JSON object, and without these quote, MYSQL says.. No!

So do you have an idea to transform this ->

insert into `users` (`facebook`, `facebookId`) values ({"profile":{"id":"1306478419467189","displayName":"Popi Popo","name":{},"provider":"facebook","_raw":"{\"id\":\"1306478419467189\",\"name\":\"Popi Popo\"}","_json":{"id":"1306478419467189","name":"Popi Popo"}},"accessToken":"EAAbY4lfNNakBAokokigv5uYzoh225VZC3LwMcPcWohwwITqpQerNTjUTD2gBInKISPDft60ZBoYQ1cq950cw8v58LW4QCPy4MxLXthRgro3xNZBDxViloyI8y6THiWD8s5tGv7r822M2OrHAKZAo2Yzb0Y5zgU4x4GGq5R4ZC0AZDZD"}, '1300408410467080')

to

insert into `users` (`facebook`, `facebookId`) values ('{"profile":{"id":"1306478419467189","displayName":"Popi Popo","name":{},"provider":"facebook","_raw":"{\"id\":\"1306478419467189\",\"name\":\"Popi Popo\"}","_json":{"id":"1306478419467189","name":"Popi Popo"}},"accessToken":"EAAbY4lfNNakBAokokigv5uYzoh225VZC3LwMcPcWohwwITqpQerNTjUTD2gBInKISPDft60ZBoYQ1cq950cw8v58LW4QCPy4MxLXthRgro3xNZBDxViloyI8y6THiWD8s5tGv7r822M2OrHAKZAo2Yzb0Y5zgU4x4GGq5R4ZC0AZDZD"}', '1300408410467080')

Thank :-)

daffl commented 7 years ago

What version of feathers-authentication are you using?

ekryski commented 7 years ago

I don't think this is a Feathers or feathers-authentication issue. Feathers-authentication isn't doing anything special to the JSON object. That is on you as the developer, to customize the data in a before hook before it is inserted in the DB.

@Clowning is this still an issue for you?

ekryski commented 7 years ago

Since we haven't heard anything back in some time, I'm going to close this issue and assume it's been resolved. If it is still an issue we can re-open. 😄

jonathanroze commented 7 years ago

Oh i'm sorry ! It good, it's just because i'm stupid ! Not feathers :D ahha