Skip to content

Commit

Permalink
Fixed FB logging redirecting to 404 due to undefined api version
Browse files Browse the repository at this point in the history
  • Loading branch information
rwky committed Mar 19, 2018
1 parent 64d3ee2 commit 0145afb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.3.1

* Fixed FB logging redirecting to 404 due to undefined api version

# 2.3.0

* Updated default graph API version to 2.12 @rwky
4 changes: 2 additions & 2 deletions lib/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var OAuth2Strategy = require('passport-oauth2')
*/
function Strategy(options, verify) {
options = options || {};
var graphApiVersion = options.graphApiVersion || this.defaultGraphApiVersion;
var graphApiVersion = options.graphApiVersion || Strategy.defaultGraphApiVersion;
options.authorizationURL = options.authorizationURL || 'https://www.facebook.com/' + graphApiVersion + '/dialog/oauth';
options.tokenURL = options.tokenURL || 'https://graph.facebook.com/' + graphApiVersion + '/oauth/access_token';
options.scopeSeparator = options.scopeSeparator || ',';
Expand All @@ -61,7 +61,7 @@ function Strategy(options, verify) {
}

// Set the default API version once
Strategy.prototype.defaultGraphApiVersion = 'v2.12';
Strategy.defaultGraphApiVersion = 'v2.12';


// Inherit from `OAuth2Strategy`.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "passport-facebook-rwky",
"version": "2.3.0",
"version": "2.3.1",
"description": "Facebook authentication strategy for Passport.",
"keywords": [
"passport",
Expand Down
2 changes: 1 addition & 1 deletion test/strategy.profile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* jshint expr: true */

var FacebookStrategy = require('../lib/strategy')
, graphApiVersion = FacebookStrategy.prototype.defaultGraphApiVersion;
, graphApiVersion = FacebookStrategy.defaultGraphApiVersion;


describe('Strategy#userProfile', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/strategy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

var chai = require('chai')
, FacebookStrategy = require('../lib/strategy')
, graphApiVersion = FacebookStrategy.prototype.defaultGraphApiVersion;
, graphApiVersion = FacebookStrategy.defaultGraphApiVersion;

describe('Strategy', function() {

Expand Down

0 comments on commit 0145afb

Please sign in to comment.