summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-05-22 19:45:06 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-05-22 19:45:06 +0200
commit82431349ff8c939326af3a986b1f543ab9878000 (patch)
treebbdd1164d9a9ba8f83d32bd2e2dcd1de1532be5b
parent6fe08cd4b3a0db0695db13a1b95cab7834de3ba6 (diff)
downloadwekan-82431349ff8c939326af3a986b1f543ab9878000.tar.gz
wekan-82431349ff8c939326af3a986b1f543ab9878000.tar.bz2
wekan-82431349ff8c939326af3a986b1f543ab9878000.zip
Remove cached board data when the client log out
Fixes #161.
-rw-r--r--server/publications/boards.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/publications/boards.js b/server/publications/boards.js
index 0ff34750..6a4e476d 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.