diff --git a/src/app/HomePage.js b/src/app/HomePage.js index d0888ae..fbd428a 100644 --- a/src/app/HomePage.js +++ b/src/app/HomePage.js @@ -79,12 +79,26 @@ function UserLoginLogout() { const { user, isAuthenticated, loginWithRedirect, logout } = useAuth0(); if (isAuthenticated) { - console.log(user); + // NOTE: Users created correctly should have these attributes... but I'm + // coding defensively, because third-party integrations are always a + // bit of a thing, and I don't want failures to crash us! const username = user["https://oauth.impress-2020.openneo.net/username"]; + const id = user.sub?.match(/^auth0\|impress-([0-9]+)$/)?.[1]; return ( - Hi, {username}! + {username && Hi, {username}!} + {id && ( + + )}