Skip to content

Commit

Permalink
Merge pull request #14 from webstersx/master
Browse files Browse the repository at this point in the history
fetches userId from the oauth_token (the part before '-') if manually…
  • Loading branch information
ghaiklor committed Oct 19, 2015
2 parents 81101ac + b4586eb commit 8302158
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class TwitterTokenStrategy extends OAuthStrategy {

let token = (req.body && req.body[this._oauthTokenField]) || (req.query && req.query[this._oauthTokenField]);
let tokenSecret = (req.body && req.body[this._oauthTokenSecretField]) || (req.query && req.query[this._oauthTokenSecretField]);
let userId = (req.body && req.body[this._userIdField]) || (req.query && req.query[this._userIdField]);
let userId = (req.body && req.body[this._userIdField]) || (req.query && req.query[this._userIdField]) || (token && token.split('-')[0]);

if (!token) return this.fail({message: `You should provide ${this._oauthTokenField} and ${this._oauthTokenSecretField}`});

Expand Down

0 comments on commit 8302158

Please sign in to comment.