fix to 401 user not found (can't use @byId)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user