Created
December 30, 2011 16:31
-
-
Save ashaw/1540524 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/public/javascripts/app/models/schools_fb.js b/public/javascripts/app/models/schools_fb.js | |
index a64a106..c851723 100644 | |
--- a/public/javascripts/app/models/schools_fb.js | |
+++ b/public/javascripts/app/models/schools_fb.js | |
@@ -46,9 +46,9 @@ propublica.models.SchoolsFB = propublica.Model.extend({ | |
saveAccessToken : function(e, status) { | |
if (status['status'] !== "connected") return; | |
- var user_id = status['session']['uid']; | |
- var access_token = status['session']['access_token']; | |
- var expires = status['session']['expires']; | |
+ var user_id = status['authResponse']['userID']; | |
+ var access_token = status['authResponse']['accessToken']; | |
+ var expires = status['authResponse']['expiresIn']; | |
$.post(RAILS_ROOT + 'tokens/create.json', { | |
token : { | |
diff --git a/public/javascripts/app/views/fb_authorize.js b/public/javascripts/app/views/fb_authorize.js | |
index 1434685..fc003e5 100644 | |
--- a/public/javascripts/app/views/fb_authorize.js | |
+++ b/public/javascripts/app/views/fb_authorize.js | |
@@ -14,7 +14,7 @@ propublica.views.fbAuthorize = propublica.View.extend({ | |
login : function(e) { | |
e.preventDefault(); | |
FB.login(function(response) {}, { | |
- perms:'email,user_education_history,user_groups,user_likes,user_hometown,user_work_history,publish_stream,read_stream' | |
+ scope:'email,user_education_history,user_groups,user_likes,user_hometown,user_work_history,publish_stream,read_stream' | |
}); | |
}, | |
diff --git a/public/javascripts/app/views/fb_init.js b/public/javascripts/app/views/fb_init.js | |
index 87710d3..b069cd3 100644 | |
--- a/public/javascripts/app/views/fb_init.js | |
+++ b/public/javascripts/app/views/fb_init.js | |
@@ -20,7 +20,7 @@ propublica.views.fbInit = propublica.View.extend({ | |
SchoolsFB.fire('fbAuthStatus', response); | |
}); | |
- FB.Event.subscribe('auth.sessionChange', function(response) { | |
+ FB.Event.subscribe('auth.statusChange', function(response) { | |
// stash me if we don't already have it: | |
if (response['status'] === "connected" && typeof SchoolsFB.me === 'undefined') { | |
FB.api('/me', function(meObj) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment