Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update facebook URLs to use facebook Graph v2.3 #78

Merged
merged 1 commit into from Apr 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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