Strapi V4 Retrieve User Role / Extend Login Response


how could I extend the response that is returned by strapi upon a successful login?
I created a user via the users-permissions plugin and logged in with email + password and strapi returns the jwt token as well as a very basic user object.

How could I for example extend this response and retrieve the role when logging in?


I have the same doubt.

On v3 it automatically return news fields that I would add to User.

Tried to use populate, no success

Hi there. I think you need to overwrite the users-permissions extension.

You can check an example here (done by a friend of mine :wink: ):

Hope it helps.

See also this response: Create custom endpoint for Users in strapi v4 - #2 by Andrew_Andrew