-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when new user is created and role is left blank #22488
Comments
Just tested this, but under sqlite, and it works for me. Mh your response should also not be code 204 but a 200 since we do return the primary key of the created user(s), see: directus/api/src/controllers/users.ts Lines 45 to 53 in 9a6e236
|
One possible reason I can see the I can replicate this issue if I set the permissions of the current user, that is creating the new user, to be too restrictive, such that they are not able to read the just created user. Do you have any permissions (on |
Here are some steps I've taken:
This only happens when a role is not selected from the non-required select input when creating a user. Strangely, when I follow the same steps as an admin, the user is created without incident, and no error is returned. |
Any hooks that are run by any of your extensions? That it works as an admin still leads me to believe this might be permissions related 🤔 |
@hanneskuettner Good question, but no, I have no extensions loaded. I agree it seems like a permissions issue, but the role was just created and the only thing modified are assigning full permissions to I'll keep looking in to it and post back any findings. |
As far as I can tell from your report, the |
@hanneskuettner Thank you for all your insight on this issue. It's much appreciated. I'll be looking in to this further. |
Describe the Bug
When a new user is created in the app, the role is not required. If a role is not chosen, the user is added to the database correctly, but a
can't convert undefined to object
error message is returned to the user.To Reproduce
Do not select a role when creating a new user:
Unexpected error appears:
User is added without apparent incident:
Directus Version
v10.11.0
Hosting Strategy
Self-Hosted (Docker Image)
Database
MySQL 8
The text was updated successfully, but these errors were encountered: