mirror of
https://github.com/Thream/socketio-jwt.git
synced 2024-07-21 09:38:31 +02:00
merge
This commit is contained in:
commit
2897f90d7f
@ -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();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user