Skip to content

Commit

Permalink
Declare variables for Facebook configuration results.
Browse files Browse the repository at this point in the history
  • Loading branch information
davelester committed Apr 13, 2013
1 parent 41c7829 commit 7fe448c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/backpack.js
Expand Up @@ -428,6 +428,8 @@ exports.facebookSharing = function (request, response, callback) {
var comment = request.body.facebookComment;
var fbAutomaticPush = request.body.facebookAutomaticPush;
var user = request.user;
var appId = configuration.get('facebook').app_id;
var appSecret = configuration.get('facebook').app_secret;

fb.publishBadge(accessToken, badgeBodyHash, userId, function(error, response) {
if (error) {
Expand All @@ -447,7 +449,7 @@ exports.facebookSharing = function (request, response, callback) {
// if FB automatic push was checked:
if (fbAutomaticPush) {
// Extend user's token
fb.extendUserAccessToken(configuration.get('facebook').app_id, configuration.get('facebook').app_secret, accessToken, function(error, response) {
fb.extendUserAccessToken(appId, appSecret, accessToken, function(error, response) {
// And save the extended token to the database
user.set('fb_access_token', response);
user.save();
Expand Down

0 comments on commit 7fe448c

Please sign in to comment.