2
1
mirror of https://github.com/Thream/socketio-jwt.git synced 2024-07-21 09:38:31 +02:00

Merge branch 'patch-1' of https://github.com/gfetco/socketio-jwt into gfetco-patch-1

This commit is contained in:
José F. Romaniello 2015-11-09 08:12:08 -03:00
commit 0bc14474c6

View File

@ -27,7 +27,6 @@ function noQsMethod(options) {
if(options.required){
clearTimeout(auth_timeout);
}
jwt.verify(data.token, options.secret, options, function(err, decoded) {
// error handler
var onError = function(err, code) {
if (err) {
@ -42,6 +41,12 @@ function noQsMethod(options) {
}
};
if(typeof data.token !== "string") {
return onError({message: 'invalid token datatype'}, 'invalid_token');
}
jwt.verify(data.token, options.secret, options, function(err, decoded) {
if (err) {
return onError(err, 'invalid_token');
}