I've been looking at this issue for a couple of days now. I thought at first that I might be losing my marbles, so I rebuild the app from scratch to see if I could isolate what's going on. Following the documentation on authenticating users, I tried to do exactly the same thing and got back a totally different result.
curl -X POST -H "Content-Type:application/json" \
> -d '{"email": "somebody@somedomain.com", "password":"password", "ttl": 1209600000}' \
> http://localhost:3000/v1/users/login
Result:
{
"id": "XeXMzum40E9Gi8jY3OJIL1qRoXySiyLEG29OUhJi0dPt92Gbzl72ZMrsvg6v4DpK",
"ttl": 31556926,
"created": "2014-06-26T22:53:48.271Z"
}
So, not only is it not associating a token with a userId like it does in the example given in the docs, but it's also messing with the TTL value. This is on a fresh project created via slc lb project myApp.
My slc -v output:
strong-cli v2.5.5 (node v0.10.29)
node-inspector v0.7.4
strong-build v0.1.0
strong-cluster-control v0.4.0
strong-registry v1.1.0
strong-supervisor v0.2.3 (strong-agent v0.4.9, strong-cluster-control v0.4.0)
My package.json:
{
"version": "0.0.1",
"main": "app.js",
"bin": "server.js",
"scripts": {
"start": "node app.js"
},
"dependencies": {
"lodash": "^2.4.1",
"loopback": "1.x >=1.7.0",
"loopback-connector-mongodb": "^1.4.0",
"loopback-datasource-juggler": "^1.6.1",
"moment": "^2.7.0"
},
"optionalDependencies": {
"loopback-explorer": "~1.1.0",
"loopback-push-notification": "~1.2.0"
},
"name": "myApp"
}
I've been looking at this issue for a couple of days now. I thought at first that I might be losing my marbles, so I rebuild the app from scratch to see if I could isolate what's going on. Following the documentation on authenticating users, I tried to do exactly the same thing and got back a totally different result.
Result:
{ "id": "XeXMzum40E9Gi8jY3OJIL1qRoXySiyLEG29OUhJi0dPt92Gbzl72ZMrsvg6v4DpK", "ttl": 31556926, "created": "2014-06-26T22:53:48.271Z" }So, not only is it not associating a token with a userId like it does in the example given in the docs, but it's also messing with the TTL value. This is on a fresh project created via
slc lb project myApp.My
slc -voutput:My package.json:
{ "version": "0.0.1", "main": "app.js", "bin": "server.js", "scripts": { "start": "node app.js" }, "dependencies": { "lodash": "^2.4.1", "loopback": "1.x >=1.7.0", "loopback-connector-mongodb": "^1.4.0", "loopback-datasource-juggler": "^1.6.1", "moment": "^2.7.0" }, "optionalDependencies": { "loopback-explorer": "~1.1.0", "loopback-push-notification": "~1.2.0" }, "name": "myApp" }