KindeK
Kinde2y ago
4 replies
moroshko

`await getUser()` doesn't return the first and last name

In my Next.js App Router application, in a page component, I get the user:
const { getUser } = getKindeServerSession();

const user = await getUser();

console.log(user);

However, the first and last names are undefined:
{
  family_name: undefined,
  given_name: undefined,
  picture: null,
  email: 'my.email@gmail.com',
  id: 'kp_e302a65c21bb45a7aaa378ccb9812345'
}

I double checked on the Kinde User page that the user id and the email are the same and that the first and last names are set there.

What am I missing?
Was this page helpful?