The following JavaScript command performs two primary functions:
- Identifies the user's authentication status.
- Retrieves the user's name if authenticated.
Copy and paste this sample into the JavaScript section of the custom component editor.
if (user.isAuthenticated) {
document.querySelector("#name").innerText = user.profile.displayName
}