Skip to content

Commit

Permalink
Merge pull request #15 from rootty/dev
Browse files Browse the repository at this point in the history
Use string instead of integer for id.
  • Loading branch information
ghaiklor committed Mar 19, 2016
2 parents c7735b1 + 02e4522 commit be9ec1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class TwitterTokenStrategy extends OAuthStrategy {
let json = JSON.parse(body);
let profile = {
provider: 'twitter',
id: json.id,
id: json.id_str ? json.id_str : String(json.id),
username: json.screen_name,
displayName: json.name,
name: {
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/profile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default JSON.stringify({
id: '1234',
id: 710474596655480832,
id_str: '710474596655480832',
screen_name: 'ghaiklor',
name: 'Eugene Obrezkov',
profile_image_url_https: 'IMAGE_URL'
Expand Down
2 changes: 1 addition & 1 deletion test/unit/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe('TwitterTokenStrategy:userProfile', () => {
if (error) return done(error);

assert.equal(profile.provider, 'twitter');
assert.equal(profile.id, '1234');
assert.equal(profile.id, '710474596655480832');
assert.equal(profile.username, 'ghaiklor');
assert.equal(profile.displayName, 'Eugene Obrezkov');
assert.deepEqual(profile.photos, [{value: 'IMAGE_URL'}]);
Expand Down

0 comments on commit be9ec1b

Please sign in to comment.