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

thanks to @chill117

we can't check undefined for undefined
This commit is contained in:
Screeny 2013-11-14 21:48:01 +01:00
parent 928cd508ff
commit 2a3cfdb8ff

View File

@ -46,10 +46,10 @@ function authorize(options) {
auth.store.get(data.sessionID, function(err, session){ auth.store.get(data.sessionID, function(err, session){
if(err) if(err)
return auth.fail(data, 'Error in session store.', true, accept); 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) if(!session)
return auth.fail(data, 'No session found', false, accept); 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]; var userKey = session[auth.passport._key][auth.userProperty];