fix to 401 user not found (can't use @byId)

This commit is contained in:
Tyler Renelle 2013-03-09 10:26:08 -05:00
parent 3407565d37
commit 155747bfd0
2 changed files with 2 additions and 1 deletions

View file

@ -19,6 +19,7 @@ module.exports.allowCrossDomain = (req, res, next) ->
res.header "Access-Control-Allow-Methods", "OPTIONS,GET,POST,PUT,HEAD,DELETE"
res.header "Access-Control-Allow-Headers", "Content-Type,X-Requested-With,x-api-user,x-api-key"
# wtf is this for?
if req.method is 'OPTIONS'
res.send(200);
else

View file

@ -70,7 +70,7 @@ userAccess = (store) ->
###
REST = (store) ->
store.query.expose "users", "withIdAndToken", (uid, token) ->
@byId(uid)
@where("id").equals(uid)
.where('apiToken').equals(token)
.findOne()