Is it possible to know user role on authentication

System Information
  • Strapi Version: 4.0.0
  • Operating System: MacOS
  • Database: PostgreSQL
  • Node Version: 16.13.1
  • NPM Version:
  • Yarn Version:

When logging in as a User using the ‘/auth/local’ call. Is it possible to also return the Role of that given user?

1 Like

When you login with a user you will get a token back. You can then use the token and make a call to /users/me and it will give the role back in that response. It’s an extra call but saves you from modifying the auth local login provider etc.

In the response you can do to get the name of the role it’s an object looking like this

  "role": {
    "id": "string",
    "name": "string",
    "description": "string",
    "type": "string",
    "permissions": [
    "users": [
    "created_by": "string",
    "updated_by": "string"

Tried that, a call to api/users/me with the bearer token returns the user data and not the role of the user. What can I do about that?


Same here I made sure to give the role permissions to find and findOne role too. Doesn’t seem like the /me endpoint returns that data.

1 Like

Since Strapi version 4.2.2 the route api/users/me no longer returns the role field in the user data but accepts populating (see
So now to get the user’s role you need to populate the role field, thus the call will be api/users/me?populate=role.
Note that you also need to give the role permissions to find role too.

1 Like

Add the ‘populate’ query like this: /api/users/me?populate=* This will return everything including the role of the user.

1 Like

thanks man that’s work fine

1 Like

Dont forget to allow role in perms:

Otherwise you will not see roles, even with populate.

1 Like