From 2a3cfdb8fffe872cbaf60b581fb44d642b223714 Mon Sep 17 00:00:00 2001 From: Screeny Date: Thu, 14 Nov 2013 21:48:01 +0100 Subject: [PATCH] thanks to @chill117 we can't check undefined for undefined --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 31ba3f3..b02ea5a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -46,10 +46,10 @@ function authorize(options) { auth.store.get(data.sessionID, function(err, session){ if(err) return auth.fail(data, 'Error in session store.', true, accept); - if(!session[auth.passport._key]) - return auth.fail(data, 'Passport was not initialized', true, accept); if(!session) return auth.fail(data, 'No session found', false, accept); + if(!session[auth.passport._key]) + return auth.fail(data, 'Passport was not initialized', true, accept); var userKey = session[auth.passport._key][auth.userProperty];