socketio-jwt
Advanced tools
Comparing version 4.3.2 to 4.3.3
@@ -30,5 +30,4 @@ var xtend = require('xtend'); | ||
} | ||
jwt.verify(data.token, options.secret, options, function(err, decoded) { | ||
// error handler | ||
var onError = function(err, code) { | ||
// error handler | ||
var onError = function(err, code) { | ||
if (err) { | ||
@@ -44,3 +43,9 @@ code = code || 'unknown'; | ||
} | ||
}; | ||
}; | ||
if(typeof data.token !== "string") { | ||
return onError({message: 'invalid token datatype'}, 'invalid_token'); | ||
} | ||
jwt.verify(data.token, options.secret, options, function(err, decoded) { | ||
@@ -47,0 +52,0 @@ if (err) { |
{ | ||
"name": "socketio-jwt", | ||
"version": "4.3.2", | ||
"version": "4.3.3", | ||
"description": "authenticate socket.io connections using JWTs", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25526
18
439