Title: "Created by" Field Not Populating on Content Creation via Authenticated POST Request in Strap


I’m experiencing an issue with Strapi v4 where the “Created by” field is not being automatically populated when new content is created through the API, despite using authenticated POST requests with a valid JWT.

Here’s what I’ve done so far:

Confirmed that the JWT used is valid and comes from a user who is recognized and authorized in Strapi.
Ensured that the user role associated with the JWT has the required permissions to create entries in the specific collection type (test).
Verified that the request is made with the JWT in the Authorization header correctly formatted as Bearer {token}.
Checked that the test content type has a user relation field set up to link entries to the User model, intended to track the user creating the content.
The POST request is successful, and the content is created in Strapi, but the “Created by” field is blank in the admin panel, and the related user is not displayed. This occurs even when creating entries directly through Postman.

Could the switch from using an API token to JWT authentication be causing the “Created by” field to remain unpopulated? Is there a known issue or additional configuration step I may be missing that’s necessary for the “Created by” field to reflect the correct user?

Any insights or suggestions would be greatly appreciated.

This topic has been created from a Discord post (1216879038757339246) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

I am using Strapi v4.14.2, and it’s in a docker container.