Open anastasiaalt opened 8 years ago
you have an unexpected token when you parse the data. are you sure it's coming back as json? you might try console.logging the response. as for the headers, in the example code "authorization" is capitalized. does that matter? also, those are headers and shouldnt be included as form data. how do you configure headers with the request module? finally if your schema data doesnt conform you can always change it or just keep user in session.
Link and code below. https://github.com/anastasiaalt/finalProject/blob/master/app.js
Getting an error I can see in terminal connected to manner in which I am using request. I embedded the request.get inside the request.post so I could use the accessToken. I originally tried it outside but I didn't see how I could access the data.
I am also not sure how to connect the data I get from LinkedIn to my users collection given the User model I have does not fit with the information being gathering from LinkedIn. I took a shot below but can't even get code running that far to see what kind of an error I would get there.