User role "nobody" output on front but not all browsers

Hey everyone, I’m trying to display users on my website front page, filtering them by roles.

But I’m actually facing an issue on Chrome/Safari, the roles I can read on Firefox with $user->role()->name() is actually displaying ["id"]=> string(6) "nobody" ["name"]=> string(6) "nobody" on other browsers.

I tried to get them on controllers, templates and JSON, same result everytime.

Could it be because names are not default and admin but custom names as resident ?

There shouldn’t be a difference between browsers since this is server-side PHP.

If you’re seeing a difference in output, it’s probably because you have an active session (e.g. being connected to the panel with a specific user) in one browser but not in the other browsers you’re testing.

Now, regarding why $user->role()->name() would sometimes return an array with name and id keys, I don’t know. That doesn’t seem right. Can you show your code?

the filename of the user blueprint yaml file and the set role within the users index.php must match for the role to be applied correctly. i would have assumed that setting an invalid role for a user would fallback to the default role. but maybe a support member can confirm that.

if you get a “nobody” it might because it can not find the definition for the default user either.

The issue was because of Kirby security restrictions, I wasn’t logged in other browsers as @fvsch said, and the roles can’t be publics, even if it’s default.

So what I did is to make a public role field like this:

fields:
  role_public:
    label: Public Role
    type: hidden
    default: resident

And I made a special route in the config.php to update all users content.