ソースを参照

Remove cached board data when the client log out

Fixes #161.
Maxime Quandalle 10 年 前
コミット
82431349ff
1 ファイル変更3 行追加2 行削除
  1. 3 2
      server/publications/boards.js

+ 3 - 2
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.