Hi @dannywinnick,
You may find the JavaScript Quickstart helpful: Auth0 JavaScript SDK Quickstarts: Login
As shown in the sample app, you can get the user info like so:
/**
* Updates the user interface
*/
const updateUI = async () => {
try {
const isAuthenticated = await auth0.isAuthenticated();
if (isAuthenticated) {
const user = await auth0.getUser();
document.getElementById("profile-data").innerText = JSON.stringify(
user,
null,
2
);
document.querySelectorAll("pre code").forEach(hljs.highlightBlock);
eachElement(".profile-image", (e) => (e.src = user.picture));
eachElement(".user-name", (e) => (e.innerText = user.name));
eachElement(".user-email", (e) => (e.innerText = user.email));
eachElement(".auth-invisible", (e) => e.classList.add("hidden"));
eachElement(".auth-visible", (e) => e.classList.remove("hidden"));
} else {
eachElement(".auth-invisible", (e) => e.classList.remove("hidden"));
eachElement(".auth-visible", (e) => e.classList.add("hidden"));
}
} catch (err) {
console.log("Error updating UI!", err);
return;
}
console.log("UI updated");
};
The code above updates the UI with profile info for the logged-in user.