I’m new to Auth0 so this might be a newb question. When I look at a user’s raw JSON directly in Auth0, I can see various details like email, email_verified, identities, etc. But when accessing the /api/auth/me API route in the Next.js-Auth0 SDK, it only returns a few parameters like nickname, name, and picture, among a few others.
Is this an issue with configuration on admin side? I also noticed that when I register a user, the email address is put into the “name” field for some reason. At the very least, I need to be able to fetch the user’s email and metadata as part of the profile. Any assistance/advice is appreciated.
UPDATE:
Seems like I’ve found a starting point. Still not clear whether it’s my user error or if there’s an inconsistency, but the details can be found here in this issue I filed in the repo:
I figured out the problem. It was user error. Derp derp.
When running Auth0 on Next.js, you have the ability to set various parameters via environment variables. I had completely forgotten I’d set the scope in there.
So my .env.local file had this:
...
AUTH0_SCOPE="openid profile"
...
And subsequently, the default behavior was not showing the user’s email. However, it looks like specifying it explicitly in the API routes does override the environment variable.