I recently setup an instance of Strapi and Postgres via railway (https://railway.app), and tried making a few request to test the api. Upon making POST request to fetch/ update a user that was originally setup through Strapi admin, I am getting an Email already taken
404 error message.
https://freeimage.host/i/HCvcw0P
Content-Type
by adding a user_role
field via Strapi admin (Note that this is not meant to replace the default Strapi user role).GET Request
to https://my-railway-url/api/users
to retrieve ALL USERS
successfully.https://my-railway-url/api/auth/local
to get user info along with the JWT token
JWT token
along with user information.JWT Token
and made another POST request - with body set to JSON
, entered info to update the existing userEmail already taken
User information updated with the new entries.
the strapi
user-permissions
plugin, has it's own logic of controllers, with would not be the same as standard content-type api's
to use it you have following routes:
// LOGIN
url: `api/auth/local`
method: POST
body: {
identifier: string
password: string
}
// ME get current authenticated user
url: `api/users/me` // you can add '?populate=*' here
method: GET
// UPDATE USER
url: `api/users/:id` // you can add '?populate=*' here
method: POST
body: {
...data // < user data
}
seems ?id=3
is invalid in your query, should be /api/users/3