parse-server
parse-server copied to clipboard
POST /1/users response doesn't include name, email and username (as did Parse.com)
Creating a new user in ParseServer via POST /1/users doesn't return some of the data which was posted as Parse.com does.
Request example for Parse.com
curl -X POST \
-H "X-Parse-Application-Id: XXXXX" \
-H "X-Parse-REST-API-Key: XXXXX" \
--data-urlencode "{
\"email\": \"[email protected]\",
\"name\": \"My Name\",
\"password\": \"apassword\",
\"username\": \"[email protected]\"
}" \
https://api.parse.com/1/users
Response
{
"createdAt": "2016-09-29T14:24:30.005Z",
"email": "[email protected]",
"name": "My Name",
"name_search": "my name",
"notifyOnComment": true,
"notifyOnMessage": true,
"objectId": "cw8JgmU3J4",
"sessionToken": "r:xxxxxxxxxxxxxxxxxxxxxxx",
"username": "[email protected]"
}
Steps to reproduce
Please include a detailed list of steps that reproduce the issue. Include curl commands when applicable.
- Copy the exact cURL command generated via Parse.com API Console when creating a user
- Run the same command on your hosted ParseServer environment by simply changing the host URL
- Compare the results
Expected Results
Using the example from above, this is the expected result as we have come to know it
{
"createdAt": "2016-09-29T14:24:30.005Z",
"email": "[email protected]",
"name": "My Name",
"name_search": "my name",
"notifyOnComment": true,
"notifyOnMessage": true,
"objectId": "cw8JgmU3J4",
"sessionToken": "r:xxxxxxxxxxxxxxxxxxxxxxx",
"username": "[email protected]"
}
Actual Outcome
When we run this:
curl -X POST \
-H "X-Parse-Application-Id: XXXXX" \
-H "X-Parse-REST-API-Key: XXXXX" \
--data-urlencode "{
\"email\": \"[email protected]\",
\"name\": \"My Name\",
\"password\": \"apassword\",
\"username\": \"[email protected]\"
}" \
http://localhost:1337/1/users
... we get this:
{
"objectId": "cw8JgmU3J4",
"createdAt": "2016-09-29T14:24:30.005Z",
"notifyOnComment": true,
"notifyOnMessage": true,
"name_search": "my name",
"sessionToken": "r:xxxxxxxxxxxxxxxxxxxxxxx"
}
As you see, we're missing name, username, and email, all of which are part of the request and eventual _User object.
Environment Setup
- Server
- parse-server version: 2.2.22
- Operating System: Mac OSX 10.11.5 (local NodeJS)
- Hardware: MacBook Pro (Retina, 13-inch, Late 2013)
- Localhost or remote server? Localhost
- Database
- MongoDB version: 3.2.1
- Storage engine: wiredTiger
- Hardware: Local - same as above
- Localhost or remote server? Local
You have to use http://localhost:1337/parse/user instead on /1/user or check which url you are loading you parse server then On .