Skip to content

Instantly share code, notes, and snippets.

@connortreacy
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connortreacy/6dc7ea54a6673775d78d to your computer and use it in GitHub Desktop.
Save connortreacy/6dc7ea54a6673775d78d to your computer and use it in GitHub Desktop.
Getting a Parse.User for an authenticated Facebook user.
function authenticateParseUser(authResponse) {
Parse.FacebookUtils.logIn({
id: authResponse.userID,
access_token: authResponse.accessToken,
expiration_date: moment().add('s', authResponse.expiresIn).format()
}).then(function(user){
/* Do useful stuff with your new Parse.User */
}, function(error){
/* Something went wrong with the authentication */
});
}
@connortreacy
Copy link
Author

Note that I'm using moment.js to convert from an expiresIn timestamp to a Parse compatible date format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment