botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
78 stars 87 forks source link

Cannot convert a user to admin role if they existed as chat user (usually with some non-default auth) #1609

Closed sadda11asm closed 2 years ago

sadda11asm commented 2 years ago

Describe the bug The bug has different use cases where it happens: The first is when the user has talked to the bot and authenticated with SSO, and then they cannot be added as an admin. The error shows the user exists. The second is when the user was an admin and also a chat user, and they cannot access the privileges of admin because Botpress thinks they are chat users. (Usually when in the database the chat user entity goes before the admin entity)

To Reproduce Steps to reproduce the behavior:

  1. Have SSO set up for the users
  2. Talk to the bot firstly
  3. Try to add the user with that email as an admin
  4. See an error that user exists, but not listed with other users/admins

Expected behavior Chat user entity should be ignored when adding a user as an admin. And when logging in to the system, the entity of admin should be taken instead of chat user

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

laurentlp commented 2 years ago

For anyone having this issue, you simply need to specify at least one authentication strategy in your workspace definition (workspaces.json). You will then have access to a list of users that are configured on those strategies.

github-actions[bot] commented 2 years ago

Available on v12.27.0