Skip to content

Commit

Permalink
Merge pull request #78 from beeant/facebook
Browse files Browse the repository at this point in the history
update facebook URLs to use facebook Graph v2.3
  • Loading branch information
geek committed Apr 23, 2015
2 parents 7f4e360 + 39bb10c commit 73faada
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/providers/facebook.js
Expand Up @@ -12,7 +12,7 @@ exports = module.exports = function (options) {

return {
protocol: 'oauth2',
auth: 'https://graph.facebook.com/oauth/authorize',
auth: 'https://www.facebook.com/v2.3/dialog/oauth',
token: 'https://graph.facebook.com/oauth/access_token',
scope: ['email'],
scopeSeparator: ',',
Expand All @@ -22,7 +22,7 @@ exports = module.exports = function (options) {
appsecret_proof: Crypto.createHmac('sha256', this.clientSecret).update(credentials.token).digest('hex')
};

get('https://graph.facebook.com/me', query, function (profile) {
get('https://graph.facebook.com/v2.3/me', query, function (profile) {

credentials.profile = {
id: profile.id,
Expand Down
14 changes: 7 additions & 7 deletions test/oauth.js
Expand Up @@ -847,7 +847,7 @@ describe('Bell', function () {
var custom = Bell.providers.facebook();
Hoek.merge(custom, provider);

Mock.override('https://graph.facebook.com/me', null);
Mock.override('https://graph.facebook.com/v2.3/me', null);

server.auth.strategy('custom', 'bell', {
password: 'password',
Expand Down Expand Up @@ -901,7 +901,7 @@ describe('Bell', function () {
var custom = Bell.providers.facebook();
Hoek.merge(custom, provider);

Mock.override('https://graph.facebook.com/me', Boom.badRequest());
Mock.override('https://graph.facebook.com/v2.3/me', Boom.badRequest());

server.auth.strategy('custom', 'bell', {
password: 'password',
Expand Down Expand Up @@ -955,7 +955,7 @@ describe('Bell', function () {
var custom = Bell.providers.facebook();
Hoek.merge(custom, provider);

Mock.override('https://graph.facebook.com/me', '{c');
Mock.override('https://graph.facebook.com/v2.3/me', '{c');

server.auth.strategy('custom', 'bell', {
password: 'password',
Expand Down Expand Up @@ -1051,9 +1051,9 @@ describe('Bell', function () {
var custom = Bell.providers.facebook();
Hoek.merge(custom, provider);

Mock.override('https://graph.facebook.com/me', function (uri) {
Mock.override('https://graph.facebook.com/v2.3/me', function (uri) {

expect(uri).to.equal('https://graph.facebook.com/me?appsecret_proof=d32b1d35fd115c4a496e06fd8df67eed8057688b17140a2cef365cb235817102');
expect(uri).to.equal('https://graph.facebook.com/v2.3/me?appsecret_proof=d32b1d35fd115c4a496e06fd8df67eed8057688b17140a2cef365cb235817102');
Mock.clear();
mock.stop(done);
});
Expand Down Expand Up @@ -1104,8 +1104,8 @@ describe('Bell', function () {
var custom = Bell.providers.facebook();
Hoek.merge(custom, provider);

Mock.override('https://graph.facebook.com/me', function (uri) {
expect(uri).to.equal('https://graph.facebook.com/me?appsecret_proof=d32b1d35fd115c4a496e06fd8df67eed8057688b17140a2cef365cb235817102&fields=id%2Cemail%2Cpicture%2Cname%2Cfirst_name%2Cmiddle_name%2Clast_name%2Clink%2Clocale%2Ctimezone%2Cupdated_time%2Cverified%2Cgender');
Mock.override('https://graph.facebook.com/v2.3/me', function (uri) {
expect(uri).to.equal('https://graph.facebook.com/v2.3/me?appsecret_proof=d32b1d35fd115c4a496e06fd8df67eed8057688b17140a2cef365cb235817102&fields=id%2Cemail%2Cpicture%2Cname%2Cfirst_name%2Cmiddle_name%2Clast_name%2Clink%2Clocale%2Ctimezone%2Cupdated_time%2Cverified%2Cgender');
Mock.clear();
mock.stop(done);
});
Expand Down
2 changes: 1 addition & 1 deletion test/providers.js
Expand Up @@ -48,7 +48,7 @@ describe('Bell', function () {
email: 'steve@example.com'
};

Mock.override('https://graph.facebook.com/me', profile);
Mock.override('https://graph.facebook.com/v2.3/me', profile);

server.auth.strategy('custom', 'bell', {
password: 'password',
Expand Down

0 comments on commit 73faada

Please sign in to comment.