mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
fix to 401 user not found (can't use @byId)
This commit is contained in:
parent
3407565d37
commit
155747bfd0
2 changed files with 2 additions and 1 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue