From dc37e5df6322fe6b204e305a875a5d9d6645aab7 Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Thu, 18 Mar 2021 08:56:19 +0100 Subject: [PATCH] Better update of the authorship of anonymous users Co-authored-by: Yukai Huang Signed-off-by: Giuseppe Lo Presti --- lib/note/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/note/index.js b/lib/note/index.js index badf69d7..7f215149 100644 --- a/lib/note/index.js +++ b/lib/note/index.js @@ -292,15 +292,15 @@ const updateNote = async (req, res) => { title: Note.parseNoteTitle(content), content: content, lastchangeAt: now, - authorship: req.isAuthenticated() ? [ + authorship: [ [ - req.user.id, + req.isAuthenticated() ? req.user.id : null, 0, content.length, now, now ] - ] : [] + ] }) if (!updated) {