Skip to content

Instantly share code, notes, and snippets.

@rickychilcott
Created January 29, 2013 14:57
Show Gist options
  • Save rickychilcott/4664853 to your computer and use it in GitHub Desktop.
Save rickychilcott/4664853 to your computer and use it in GitHub Desktop.
Singly and CloudMine -- Get user id
var ws = new cloudmine.WebService({
appid: 'appid',
apikey: 'apikey'
});
//Authenticate user via twitter
ws.loginSocial('twitter').on('success', function(data, response) {
// Now you can save the session token using localStorage
localStorage.setItem('cm_session', response.session_token);
console.log(data.profile.__id__); // correctly returns userid
});
$('#get_user').click(function() {
console.log(ws.isLoggedIn()); // returns true
console.log(ws.getUserID()); // returns null, should be userid?
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment