DF2 - role_id value is based on Default Role, not on the setting in the User tab


#1

Hi,

After the login, the user_id returned in the response corresponds to the Default Role, not on the one set up for the specific application.

I think that this is a bug. These are the steps to replicate the issue:

  1. setup two roles: “guest” and “registered”
  2. create an app “test1” and set the default role to “guest”
  3. create a new user and set the role for the “test1” app as “registered”

The problem is that the role_id returned for the user is always “guest”. This is the response:

The problem is that bug is blocking from having more than one role within an application. Any advises on how this can be managed?
The DF version is 2.0.1

Thank you
Gabriel


#2

The reason it show guest when you POST to user/session is because the role is being assessed before the session is established.
If you turn around and to a GET on user/session with your session token (which you just got back) and the api key, the correct role will show.


#3

Thanks Drew

I don’t like the idea of doing more than one api call for a login. Is this in plan to be fixed?
I have already an extended user dataset in a different table, for now I will use that to store the role information.

Thank you again for your reply.

Best regards
Gabriel


#4

In the latest code (2.0.4) I don’t see this behavior any more. Can you confirm?


#5

Hi Drew,

The issue is now fixed

Thank you
Gabriel