Merge branch 'yads-master'
This commit is contained in:
commit
55d5e43e27
@ -1,8 +1,12 @@
|
|||||||
function UnauthorizedError (code, error) {
|
function UnauthorizedError (code, error) {
|
||||||
Error.call(this, error.message);
|
Error.call(this, error.message);
|
||||||
this.message = error.message;
|
this.message = error.message;
|
||||||
this.code = code;
|
|
||||||
this.inner = error;
|
this.inner = error;
|
||||||
|
this.data = {
|
||||||
|
message: this.message,
|
||||||
|
code: code,
|
||||||
|
type: "UnauthorizedError"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
UnauthorizedError.prototype = Object.create(Error.prototype);
|
UnauthorizedError.prototype = Object.create(Error.prototype);
|
||||||
|
@ -17,6 +17,7 @@ describe('authorizer', function () {
|
|||||||
|
|
||||||
socket.on('error', function(err){
|
socket.on('error', function(err){
|
||||||
err.should.eql("jwt malformed");
|
err.should.eql("jwt malformed");
|
||||||
|
err.code.should.eql("invalid_token");
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user