https://supertokens.com/ logo
Title
v

vishjain

11/09/2022, 4:11 AM
when does: response.UnknownRoleError != nil while the adding a role to a user? I've created a particular role but I get this error when attempting to attach it to a user.
r

rp

11/09/2022, 4:12 AM
hey @vishjain
this happens if you have not created the role in supertokens first
v

vishjain

11/09/2022, 4:13 AM
That's weird because I've created the other roles in the same segment of code and not had an issue...
r

rp

11/09/2022, 4:15 AM
hmm. You can query the core to check all the roles that exist: https://app.swaggerhub.com/apis/supertokens/CDI/2.16.2#/User%20Roles%20Recipe/getRoles
v

vishjain

11/09/2022, 4:20 AM
Did a SQL query on the postgres container and found that the role was created before (roles table).
r

rp

11/09/2022, 4:21 AM
Hmm. Then is is possible that you have mistyped the role when associating it with the user?
v

vishjain

11/09/2022, 4:23 AM
yup
likely