diff --git a/common/models/user.js b/common/models/user.js index 69410bb2..a55209ac 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -326,7 +326,7 @@ module.exports = function(User) { var err; if (!tokenId) { err = new Error(g.f('{{accessToken}} is required to logout')); - err.status = 401; + err.statusCode = 401; process.nextTick(fn, err); return fn.promise; } @@ -336,7 +336,7 @@ module.exports = function(User) { fn(err); } else if ('count' in info && info.count === 0) { err = new Error(g.f('Could not find {{accessToken}}')); - err.status = 401; + err.statusCode = 401; fn(err); } else { fn(); diff --git a/test/user.test.js b/test/user.test.js index f8a9d98a..693939bf 100644 --- a/test/user.test.js +++ b/test/user.test.js @@ -1280,7 +1280,7 @@ describe('User', function() { it('fails when accessToken is not provided', function(done) { User.logout(undefined, function(err) { expect(err).to.have.property('message'); - expect(err).to.have.property('status', 401); + expect(err).to.have.property('statusCode', 401); done(); }); }); @@ -1288,7 +1288,7 @@ describe('User', function() { it('fails when accessToken is not found', function(done) { User.logout('expired-access-token', function(err) { expect(err).to.have.property('message'); - expect(err).to.have.property('status', 401); + expect(err).to.have.property('statusCode', 401); done(); }); });