diff --git a/lib/index.js b/lib/index.js index b02ea5a..3813b1d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -22,14 +22,14 @@ function authorize(options) { secret: null, store: null, success: function(data, accept){accept(null, true)}, - fail: function(data, message, critical, accept){accept(null, !critical)} + fail: function(data, message, critical, accept){accept(null, false)} }; - var auth = xtend({}, defaults, options ); + var auth = xtend(defaults, options); auth.userProperty = auth.passport._userProperty || 'user'; - if (typeof auth.cookieParser === 'undefined' || !auth.cookieParser) { + if (!auth.cookieParser) { throw new Error('cookieParser is required use connect.cookieParser or express.cookieParser'); } diff --git a/package.json b/package.json index ee28f24..3e7e055 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "passport.socketio", - "version": "1.2.1", + "version": "2.1.1", "description": "access passport.js authenticated user information from socket.io", "main": "lib/index.js", "keywords": [