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

Parse Server doesn't return the generated username

Open hmoqhim opened this issue 10 years ago • 1 comments

When creating anonymous user, Parse server generates a random username but it doesn't return it as part of the response, while the api.parse.com does.

On my local Parse Server 2.2.13

curl -X POST \
  -H "X-Parse-Application-Id: y2Ez0A23DzPqBPr2JgBIer5aBrCh1I4eN0zQfLlo" \
  -H "X-Parse-Client-Key: wzv4nBpZi7hMJLFSlY7IL19P8QmwS80jgaoUEfql" \
  -H "Content-Type: application/json" \
  -d '{"authData": { "anonymous": { "id": "19f3b888-a324-4da7-a88d-46d35099224c"}}}' \
  http://localhost:1180/parse/users

Response:

{"objectId":"7qoG3BJCXu","createdAt":"2016-06-23T17:32:23.180Z","sessionToken":"r:ce14755491fd6d1d433cfb5c2c9ad6c7"}

On http://api.parse.com:

curl -X POST \
   -H "X-Parse-Application-Id:  ** REDACTED **" \
   -H "X-Parse-REST-API-Key:  ** REDACTED **" \
   -H "Content-Type: application/json" \
   -d '{"authData": { "anonymous": { "id": "19f3b888-a324-4da7-a88d-46d35099224c"}}}' \
   https://api.parse.com/1/users

Response:

{"createdAt":"2016-06-23T17:27:48.684Z","objectId":"nj6IEuTXTN","sessionToken":"d2J6w9JakNNa1ThywqqKLHORT","username":"HmrX4S6MrtODc4eM6LOcxKfXc"}

The logs on Parse Server:

verbose: POST /parse/users { host: 'localhost:1180',
  'x-parse-client-version': 'i1.13.0',
  accept: '*/*',
  'x-parse-application-id': 'y2Ez0A23DzPqBPr2JgBIer5aBrCh1I4eN0zQfLlo',
  'x-parse-client-key': 'wzv4nBpZi7hMJLFSlY7IL19P8QmwS80jgaoUEfql',
  'x-parse-installation-id': ** REDACTED **,
  'accept-language': 'en-us',
  'x-parse-os-version': '9.3 (15D21)',
  'accept-encoding': 'gzip, deflate',
  'content-type': 'application/json; charset=utf-8',
  'content-length': '72',
  'user-agent':  ** REDACTED **,
  connection: 'keep-alive',
  'x-parse-app-build-version': '1.1.1',
  'x-parse-app-display-version': '1.1' } {
  "authData": {
    "anonymous": {
      "id": "19f3b888-a324-4da7-a88d-46d35099224c"
    }
  }
}
verbose: {
  "status": 201,
  "response": {
    "objectId": "rdsxXqLD6o",
    "createdAt": "2016-06-23T15:46:49.275Z",
    "sessionToken": "r: r:ce14755491fd6d1d433cfb5c2c9ad6c7"
  },
  "location": "http://localhost:1180/parse/users/7qoG3BJCXu"
}

hmoqhim avatar Jun 23 '16 17:06 hmoqhim

Fixed by #2155

flovilmart avatar Jun 27 '16 03:06 flovilmart