This is about the pattern for user account page paths.

In my site I want to have different urls for the various user roles, e.g. teacher/user-name and student/user-name.

I cannot use [user:roles:first], since that would yield 'authenticated-user', which in my case needs to be on top in the roles list as it is the least permissive role. For similar reasons [user:roles:last] would not work for me either: what I need is the second role in line (the first one listed after authenticated-user), even if the user has other roles with more permissions.

So to achieve this I tried to use the following pattern:
The user-name part works, but not the role part: it is simply not there.
If I test with [user:roles:keys:value:1] I can see this gives me the correct key of the role, but the role-name itself does not appear when I use [user:roles:value:1].

I'm not sure if this is a pathauto issue or a token issue.
Any help would be much appreciated.