Created
January 29, 2013 14:57
-
-
Save rickychilcott/4664853 to your computer and use it in GitHub Desktop.
Singly and CloudMine -- Get user id
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
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