2
1
mirror of https://github.com/Thream/socketio-jwt.git synced 2024-07-21 09:38:31 +02:00
This commit is contained in:
José F. Romaniello 2014-07-16 20:32:42 -03:00
commit 2897f90d7f
2 changed files with 6 additions and 1 deletions

View File

@ -1,8 +1,12 @@
function UnauthorizedError (code, error) {
Error.call(this, error.message);
this.message = error.message;
this.code = code;
this.inner = error;
this.data = {
message: this.message,
code: code,
type: "UnauthorizedError"
};
}
UnauthorizedError.prototype = Object.create(Error.prototype);

View File

@ -17,6 +17,7 @@ describe('authorizer', function () {
socket.on('error', function(err){
err.should.eql("jwt malformed");
err.code.should.eql("invalid_token");
done();
});
});