parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

POST /1/users response doesn't include name, email and username (as did Parse.com)

Open tzabian opened this issue 10 years ago • 1 comments

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.

  1. Copy the exact cURL command generated via Parse.com API Console when creating a user
  2. Run the same command on your hosted ParseServer environment by simply changing the host URL
  3. 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

tzabian avatar Oct 11 '16 13:10 tzabian

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 .

nirmaldeol avatar Oct 26 '16 00:10 nirmaldeol