{"action":"created","issue":{"url":"https://api.github.com/repos/parse-community/Parse-SDK-JS/issues/679","repository_url":"https://api.github.com/repos/parse-community/Parse-SDK-JS","labels_url":"https://api.github.com/repos/parse-community/Parse-SDK-JS/issues/679/labels{/name}","comments_url":"https://api.github.com/repos/parse-community/Parse-SDK-JS/issues/679/comments","events_url":"https://api.github.com/repos/parse-community/Parse-SDK-JS/issues/679/events","html_url":"https://github.com/parse-community/Parse-SDK-JS/issues/679","id":370635990,"node_id":"MDU6SXNzdWUzNzA2MzU5OTA=","number":679,"title":"Load user from sessionToken in nodejs","user":{"login":"Jauny","id":1719552,"node_id":"MDQ6VXNlcjE3MTk1NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1719552?v=4","gravatar_id":"","url":"https://api.github.com/users/Jauny","html_url":"https://github.com/Jauny","followers_url":"https://api.github.com/users/Jauny/followers","following_url":"https://api.github.com/users/Jauny/following{/other_user}","gists_url":"https://api.github.com/users/Jauny/gists{/gist_id}","starred_url":"https://api.github.com/users/Jauny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jauny/subscriptions","organizations_url":"https://api.github.com/users/Jauny/orgs","repos_url":"https://api.github.com/users/Jauny/repos","events_url":"https://api.github.com/users/Jauny/events{/privacy}","received_events_url":"https://api.github.com/users/Jauny/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-16T14:18:01Z","updated_at":"2018-10-16T15:48:07Z","closed_at":"2018-10-16T15:12:55Z","author_association":"NONE","body":"Hi,\r\n\r\nI'm trying to find the best way to load/auth a user from a sessionToken. Only way I've found so far is to use the http api to call /users/me with `X-Parse-Application-Id` and `X-Parse-Session-Token` headers.\r\nI've seen conflicting answers about having to add a `X-Parse-REST-API-Key` (including on the official docs). Our parse-server is started without a rest-api-key so I should not need one.\r\n\r\nThe call I'm doing then is the following:\r\n```\r\ncurl -X GET \\\r\n  -H \"X-Parse-Application-Id: <appId>\" \\\r\n  -H \"X-Parse-Session-Token: <token>\" \\\r\n  https://<url>/parse/users/me\r\n``` \r\n\r\nI'm getting `{\"error\":\"unauthorized\"}` without additional information so I don't know what the issue is.\r\n\r\nI'm using both the `parse/node` on nodejs and `parse` lib in the browser. The `parse` lib offers a `Parse.User.become(token)` function which works, but I'm wondering why there is not an equivalent function from the nodejs lib. All I need is a `getUserFromToken` or equivalent.\r\n\r\nI've seen that there was a `Parse.Cloud.httpRequest` but it got removed from the nodejs lib. I'm using axios for the call (or as I told simply curl to test) and this is not working."},"comment":{"url":"https://api.github.com/repos/parse-community/Parse-SDK-JS/issues/comments/430290380","html_url":"https://github.com/parse-community/Parse-SDK-JS/issues/679#issuecomment-430290380","issue_url":"https://api.github.com/repos/parse-community/Parse-SDK-JS/issues/679","id":430290380,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDI5MDM4MA==","user":{"login":"Jauny","id":1719552,"node_id":"MDQ6VXNlcjE3MTk1NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1719552?v=4","gravatar_id":"","url":"https://api.github.com/users/Jauny","html_url":"https://github.com/Jauny","followers_url":"https://api.github.com/users/Jauny/followers","following_url":"https://api.github.com/users/Jauny/following{/other_user}","gists_url":"https://api.github.com/users/Jauny/gists{/gist_id}","starred_url":"https://api.github.com/users/Jauny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jauny/subscriptions","organizations_url":"https://api.github.com/users/Jauny/orgs","repos_url":"https://api.github.com/users/Jauny/repos","events_url":"https://api.github.com/users/Jauny/events{/privacy}","received_events_url":"https://api.github.com/users/Jauny/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T15:48:07Z","updated_at":"2018-10-16T15:48:07Z","author_association":"NONE","body":"Ok, I've tried with the `-H \"X-Parse-Javascript-Key: <key>\"` header and it seems to work now.\r\n\r\nI think this would be worth adding to the documentation.\r\n\r\nThanks!"}}
{"actor":{"display_login":"Jauny"}}