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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set up everyauth with an express server and invalid Twitter credentials
go to /auth/twitter
What happens:
/private/tmp/meat.me/node_modules/everyauth/lib/modules/twitter.js:43
return new Error(data.data.match(/<error>(.+)<\/error>/)[1]);
^
TypeError: Cannot read property '1' of null
at /private/tmp/meat.me/node_modules/everyauth/lib/modules/twitter.js:43:61
at /private/tmp/meat.me/node_modules/everyauth/lib/step.js:97:21
at [object Object].fail (/private/tmp/meat.me/node_modules/everyauth/lib/promise.js:53:24)
The problem is that Twitter is now returning data of the form
{
"statusCode": 401,
"data": "Failed to validate oauth signature and token"
}
Thus, data.data does not match /<error>(.+)<\/error>/ and that test returns null.
The text was updated successfully, but these errors were encountered:
Also crash can be caused by promise.fail(err) in one of the steps.
For example if findOrCreateUser returns DB error everyauth crashes with
/project/node_modules/everyauth/lib/modules/google.js:47
return new Error(data.data.match(/H1>(.+)<\/H1/)[1]);
^
TypeError: Cannot call method 'match' of undefined
at /project/node_modules/everyauth/lib/modules/google.js:47:32
To replicate:
What happens:
/private/tmp/meat.me/node_modules/everyauth/lib/modules/twitter.js:43 return new Error(data.data.match(/<error>(.+)<\/error>/)[1]); ^ TypeError: Cannot read property '1' of null at /private/tmp/meat.me/node_modules/everyauth/lib/modules/twitter.js:43:61 at /private/tmp/meat.me/node_modules/everyauth/lib/step.js:97:21 at [object Object].fail (/private/tmp/meat.me/node_modules/everyauth/lib/promise.js:53:24)
The problem is that Twitter is now returning data of the form
Thus,
data.data
does not match/<error>(.+)<\/error>/
and that test returnsnull
.The text was updated successfully, but these errors were encountered: