Skip to content

Instantly share code, notes, and snippets.

@zdwolfe
Created November 26, 2012 00:08
Show Gist options
  • Save zdwolfe/4145958 to your computer and use it in GitHub Desktop.
Save zdwolfe/4145958 to your computer and use it in GitHub Desktop.
server.serializeClient(function(clientString, done) {
// @TODO for some reason clientJSON is not valid JSON
console.log('clientString = ' + clientString);
var client = JSON.parse(clientString);
console.log('_id = ' + client._id);
console.log('name = ' + client.name);
console.log('secret = ' + client.secret);
done(null, client._id);
});
Output:
clientString = [{"name":"CollabClient","secret":"CollabClientSecret","clientID":"CollabClientID","redirectURI":"/auth/callback","_id":"50b2ad73affd031c1d000001","__v":0}]
_id = undefined
name = undefined
secret = undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment