Skip to content

Node.js based forum software built for the modern web

only logged in users can flag

Baris Soner Usaklica06a24df234
diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js
index 56bb38aea6..475466f5c6 100644
--- a/src/socket.io/posts.js
+++ b/src/socket.io/posts.js
@@ -214,6 +214,10 @@ SocketPosts.getPidPage = function(socket, pid, callback) {
}
SocketPosts.flag = function(socket, pid, callback) {
+ if (!socket.uid) {
+ return callback(new Error('not-logged-in'));
+ }
+
var message = '',
path = '';