-
-
Save mdobson/7826965 to your computer and use it in GitHub Desktop.
getLoggedInUser docs
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 apigee = new Apigee.Client({ | |
orgName:"mdobson", | |
appName:"sandbox" | |
}); | |
//getLoggedInUser | |
//An async function to get the currently authenticated user via token we store in localstorage | |
apigee.getLoggedInUser(function(err, data, user){ | |
//err is error flag | |
//Data is raw return from api | |
//User is Apigee.Entity or Usergrid.Entity object representing the authenticated user | |
if(err) { | |
//Here is where we can interact with the user object. | |
console.log(data); | |
} else { | |
var username = user.get('username'); | |
alert(username+" is lgged in!"); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment