diff --git a/package.json b/package.json index 8ee2a24..47abda2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "passport-facebook-token", - "version": "3.0.1", + "version": "3.0.2", "description": "Facebook token authentication strategy for Passport", "main": "lib/index.js", "scripts": { diff --git a/src/index.js b/src/index.js index 32f8711..ef02cc2 100644 --- a/src/index.js +++ b/src/index.js @@ -52,7 +52,7 @@ export default class FacebookTokenStrategy extends OAuth2Strategy { this._profileURL = options.profileURL || 'https://graph.facebook.com/v2.4/me'; this._clientSecret = options.clientSecret; this._enableProof = options.enableProof; - this._profileFields = options.profileFields || ['id', 'username', 'name', 'emails']; + this._profileFields = options.profileFields || ['id', 'name', 'emails']; this._oauth2._useAuthorizationHeaderForGET = false; } @@ -167,7 +167,6 @@ export default class FacebookTokenStrategy extends OAuth2Strategy { let fields = []; let map = { 'id': 'id', - 'username': 'username', 'displayName': 'name', 'name': ['last_name', 'first_name', 'middle_name'], 'gender': 'gender', diff --git a/test/unit/index.test.js b/test/unit/index.test.js index c1690f0..ac15f20 100644 --- a/test/unit/index.test.js +++ b/test/unit/index.test.js @@ -271,7 +271,7 @@ describe('FacebookTokenStrategy:userProfile', () => { sinon.stub(strategy._oauth2, 'get', (url, accessToken, next) => next(null, fakeProfile, null)); strategy.userProfile('accessToken', (error, profile) => { - assert.equal(strategy._oauth2.get.getCall(0).args[0], 'https://graph.facebook.com/v2.4/me?appsecret_proof=8c340bd01643ab69939ca971314d7a3d64bfb18946cdde566f12fdbf6707d182&fields=id,username,last_name,first_name,middle_name,email'); + assert.equal(strategy._oauth2.get.getCall(0).args[0], 'https://graph.facebook.com/v2.4/me?appsecret_proof=8c340bd01643ab69939ca971314d7a3d64bfb18946cdde566f12fdbf6707d182&fields=id,last_name,first_name,middle_name,email'); strategy._oauth2.get.restore(); done(); }); @@ -281,13 +281,13 @@ describe('FacebookTokenStrategy:userProfile', () => { let strategy = new FacebookTokenStrategy({ clientID: '123', clientSecret: '123', - profileFields: ['username', 'name', 'custom'] + profileFields: ['name', 'custom'] }, BLANK_FUNCTION); sinon.stub(strategy._oauth2, 'get', (url, accessToken, next) => next(null, fakeProfile, null)); strategy.userProfile('accessToken', (error, profile) => { - assert.equal(strategy._oauth2.get.getCall(0).args[0], 'https://graph.facebook.com/v2.4/me?fields=username,last_name,first_name,middle_name,custom'); + assert.equal(strategy._oauth2.get.getCall(0).args[0], 'https://graph.facebook.com/v2.4/me?fields=last_name,first_name,middle_name,custom'); strategy._oauth2.get.restore(); done(); });