How can I get a user role in Strapi V4? 🤔

Hello guys,

I am trying to create a project using Strapi V4. There are some differences. E.g.: After logging in, the UserRole was found in the Response in V3, but unfortunately not in V4.

What should I do? Is there an official solution for this? :thinking:

Best regards

If you’re trying to do this through the /api/users/me path, you need to populate the role field. It’s a relation now, not a string.

/api/users/me?populate=role