From 82431349ff8c939326af3a986b1f543ab9878000 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 22 May 2015 19:45:06 +0200 Subject: [PATCH] Remove cached board data when the client log out Fixes #161. --- server/publications/boards.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/publications/boards.js b/server/publications/boards.js index 0ff34750c..6a4e476dc 100644 --- a/server/publications/boards.js +++ b/server/publications/boards.js @@ -3,9 +3,10 @@ // 1. that the user is a member of // 2. the user has starred Meteor.publish('boards', function() { - // Ensure that the user is connected + // Ensure that the user is connected. If it is not, we need to return an empty + // array to tell the client to remove the previously published docs. if (! Match.test(this.userId, String)) - return; + return []; // Defensive programming to verify that starredBoards has the expected // format -- since the field is in the `profile` a user can modify it.