Comments (7)
Here are some steps I've taken:
- Disabled all flows
- Created a new role with full access permissions to CRUD to
directus_users
and full read permissions todirectus_roles
(see screenshot) - Login as a user with that role
- Attempt to create a user, only entering the first name, email, and password
POST
to/users
shows the request body of the three fields. A204
status is returned along with[UNKNOWN] can't convert undefined to object
error- Docker console simply shows a
POST /users 204
with no other errors, even with log level ofdebug
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.
from directus.
@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 directus_users
. Debugging Directus would be a whole lot easier if status codes weren't invisibly changed and meaningful error messages were at least outputted to the console...
I'll keep looking in to it and post back any findings.
from directus.
@hanneskuettner Thank you for all your insight on this issue. It's much appreciated. I'll be looking in to this further.
from directus.
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
from directus.
One possible reason I can see the /users
request return a 204 is if the item service can not read the just created user by its id
, causing a ForbiddenError
that is silently transformed into a 204 response.
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 directus_users
) set up for the role that are different from the standard minimal app permissions?
from directus.
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 🤔
from directus.
Debugging Directus would be a whole lot easier if status codes weren't invisibly changed and meaningful error messages were at least outputted to the console...
As far as I can tell from your report, the [UNKNOWN] can't convert undefined to object
error is actually a frontend only error, that is thrown because the create endpoint unexpectedly returns no content (which is an improvement all on it's own), but there aren't any errors in the API side of things, since it returns a successful 204 (just without the expected content).
from directus.
Related Issues (20)
- Throw errors when present from sdk
- How to create or delete user by only admin approval HOT 1
- why I am use .with(staticToken('staticToken')) tip Invalid user credentials HOT 3
- Manual sorting in M2M interface table layout is not obvious HOT 2
- Graphql errors getting swallowed by the SDK
- Applying a schema does not seem to invalidate the schema cache HOT 2
- Unable to Update Directus in Digital Ocean HOT 2
- Incomplete Display of Related Items in M2M Relationship
- DefineHooks Init Method Doesnt Work HOT 6
- "Cannot read properties of undefined (reading 'join')" when doing certain Custom Migrations
- Invalid filter key "version" on "directus_revisions" HOT 2
- "Inconsistent chunk size" when uploading to cloudinary via Directus
- Images get stored to cloudinary as "Raw" instead of "Image" when uploading via Directus HOT 2
- Error while creating map's Point field in Directus HOT 1
- Accessing item with share URL throws SQL error HOT 3
- FORBIDDEN modifying HOT 6
- `formatted-value` display should have an option to translate the field value
- Directus Admin-App is logging out, when doing a hard refresh HOT 1
- "Default value" is disabled on CSV fields HOT 1
- Checkboxes interface doesn't reflect default value on item creation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directus.