I'm not sure if I'm missing something in the implementation, but I'm getting errors using the LinkedIn module.
User's click the link to login and get redirected to the LinkedIn login page as expected. If they grant access to the application, there are no problems. However; if they cancel or reject the application, an error is thrown. Specifically, it complains about line 46 of linkedin.js, which is part of the convertErr method - specifically parsing a JSON response. The problem is there is no JSON response from LinkedIn. The user is sent back to the redirect URL with the oauth_problem=user_refused attribute appended.
Here's the error dump to the Node console:
SyntaxError: Unexpected token ILLEGAL
at Object.parse (native)
at /usr/local/lib/node_modules/everyauth/lib/modules/linkedin.js:46:21
at /usr/local/lib/node_modules/everyauth/lib/step.js:97:21
at [object Object].fail (/usr/local/lib/node_modules/everyauth/lib/promise.js:52:24)
at /usr/local/lib/node_modules/everyauth/lib/modules/oauth.js:151:24
at /usr/local/lib/node_modules/oauth/lib/oauth.js:345:22
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/oauth/lib/oauth.js:312:11)
at IncomingMessage.emit (events.js:81:20)
at HTTPParser.onMessageComplete (http.js:133:23)
at CleartextStream.ondata (http.js:1226:22)
Furthemore, I originally tried to add a handleAuthCallbackError before I noticed that was only implemented in the OAuth2 module, not OAuth that the LinkedIn module leverages.
So there are two things. One, am I doing something wrong here? It appears there may be bug or I'm simply too sleep derived to see the obvious. Second, it would be nice if there were an error handler in both OAuth modules to maintain consistency.
I'm not sure if I'm missing something in the implementation, but I'm getting errors using the LinkedIn module.
User's click the link to login and get redirected to the LinkedIn login page as expected. If they grant access to the application, there are no problems. However; if they cancel or reject the application, an error is thrown. Specifically, it complains about line 46 of linkedin.js, which is part of the convertErr method - specifically parsing a JSON response. The problem is there is no JSON response from LinkedIn. The user is sent back to the redirect URL with the oauth_problem=user_refused attribute appended.
Here's the error dump to the Node console:
Here's the code I'm using:
Furthemore, I originally tried to add a handleAuthCallbackError before I noticed that was only implemented in the OAuth2 module, not OAuth that the LinkedIn module leverages.
So there are two things. One, am I doing something wrong here? It appears there may be bug or I'm simply too sleep derived to see the obvious. Second, it would be nice if there were an error handler in both OAuth modules to maintain consistency.
Thanks for all the work on everyauth!