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:
parent
928cd508ff
commit
2a3cfdb8ff
@ -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];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user