From 0dca0bad21de08612ed434e676e2fe0445b08957 Mon Sep 17 00:00:00 2001 From: Aram Bayadyan Date: Sat, 4 Apr 2020 00:48:06 +0400 Subject: [PATCH] fix Meteor.server.sessions[sessionId] is undefined Meteor.server.sessions is now a Map instance, so we should use get method instead of an array index --- lib/meteor-down.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/meteor-down.js b/lib/meteor-down.js index be180a9..0d14a89 100644 --- a/lib/meteor-down.js +++ b/lib/meteor-down.js @@ -21,7 +21,7 @@ Meteor.methods({ // this does not resume subscriptions and so on, and we don't really need it // we do this at the start, so this is fine var sessionId = this.connection.id; - var session = Meteor.server.sessions[sessionId]; + var session = Meteor.server.sessions.get(sessionId); session.userId = user._id; return user; @@ -38,4 +38,4 @@ MeteorDown.login = function (params) { if(params.userId) { return Meteor.users.findOne(params.userId); } -} \ No newline at end of file +}