From f9e93ba32ebc226d05f8a353d3da99972836632c Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Wed, 6 Sep 2023 15:54:21 +0000 Subject: [PATCH 01/19] chore: incrementing version number - v3.4.1 --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 8d712e4b65..83dc54d8dc 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "3.4.0", + "version": "3.4.1", "homepage": "https://www.nodebb.org", "repository": { "type": "git", From f24a334c1d1805b7b6e066970f98283080ecd5ba Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Wed, 6 Sep 2023 15:54:21 +0000 Subject: [PATCH 02/19] chore: update changelog for v3.4.1 --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c7456e2ae..3ee1f3f3f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,38 @@ +#### v3.4.1 (2023-09-06) + +##### Chores + +* up dbsearch (8357bb2e) +* incrementing version number - v3.4.0 (fd9247c5) +* update changelog for v3.4.0 (5c023025) +* incrementing version number - v3.3.9 (5805e770) +* incrementing version number - v3.3.8 (a5603565) +* incrementing version number - v3.3.7 (b26f1744) +* incrementing version number - v3.3.6 (7fb38792) +* incrementing version number - v3.3.4 (a67f84ea) +* incrementing version number - v3.3.3 (f94d239b) +* incrementing version number - v3.3.2 (ec9dac97) +* incrementing version number - v3.3.1 (151cc68f) +* incrementing version number - v3.3.0 (fc1ad70f) +* incrementing version number - v3.2.3 (b06d3e63) +* incrementing version number - v3.2.2 (758ecfcd) +* incrementing version number - v3.2.1 (20145074) +* incrementing version number - v3.2.0 (9ecac38e) +* incrementing version number - v3.1.7 (0b4e81ab) +* incrementing version number - v3.1.6 (b3a3b130) +* incrementing version number - v3.1.5 (ec19343a) +* incrementing version number - v3.1.4 (2452783c) +* incrementing version number - v3.1.3 (3b4e9d3f) +* incrementing version number - v3.1.2 (40fa3489) +* incrementing version number - v3.1.1 (40250733) +* incrementing version number - v3.1.0 (0cb386bd) +* incrementing version number - v3.0.1 (26f6ea49) +* incrementing version number - v3.0.0 (224e08cd) + +##### Bug Fixes + +* #11981, post immediately when canceling scheduling (19b7cdb2) + #### v3.4.0 (2023-09-06) ##### Chores From f2c4041fcb5cb2820236f14b599c6f41abb91e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 6 Sep 2023 12:40:15 -0400 Subject: [PATCH 03/19] fix: prep edit so textarea isn't below text input --- public/src/client/chats/messages.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/src/client/chats/messages.js b/public/src/client/chats/messages.js index 88e03bf4bc..17c85abb37 100644 --- a/public/src/client/chats/messages.js +++ b/public/src/client/chats/messages.js @@ -198,6 +198,7 @@ define('forum/chats/messages', [ const messageControls = msgEl.find(`[component="chat/message/controls"]`); const chatContent = messageBody.parents('[component="chat/message/content"]'); + const isAtBottom = messages.isAtBottom(chatContent); messageBody.addClass('hidden'); messageControls.addClass('hidden'); editEl.insertAfter(messageBody); @@ -207,7 +208,7 @@ define('forum/chats/messages', [ textarea.focus().putCursorAtEnd(); autoresizeTextArea(textarea); - if (chatContent.length && messages.isAtBottom(chatContent)) { + if (chatContent.length && isAtBottom) { messages.scrollToBottom(chatContent); } From e4ecb96f1aca2c56aedb6efc1313a46127400f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 6 Sep 2023 12:49:37 -0400 Subject: [PATCH 04/19] fix: closes #11982, fix element in prepEdit --- public/src/client/chats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/client/chats.js b/public/src/client/chats.js index cc8e3d7133..20e81eb854 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -389,7 +389,7 @@ define('forum/chats', [ return; } const lastMid = message.attr('data-mid'); - messages.prepEdit(inputEl, lastMid, ajaxify.data.roomId); + messages.prepEdit(message, lastMid, ajaxify.data.roomId); } }); }; From aebd9278c2abac1d11dae2edd2a3aeb30a635f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 6 Sep 2023 17:01:09 -0400 Subject: [PATCH 05/19] refactor: reduce socket.emits for typing if textarea changess between empty/full emit right away --- public/src/client/chats.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 20e81eb854..53a2835e9a 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -331,9 +331,22 @@ define('forum/chats', [ textarea.on('focus', () => textarea.val() && emitTyping(true)); textarea.on('blur', () => emitTyping(false)); - textarea.on('input', utils.throttle(function () { - emitTyping(!!textarea.val()); - }, 2500, true)); + let timeoutid = 0; + let hasText = !!textarea.val(); + textarea.on('input', function () { + const _hasText = !!textarea.val(); + if (_hasText !== hasText) { + clearTimeout(timeoutid); + timeoutid = 0; + hasText = _hasText; + emitTyping(hasText); + } else if (!timeoutid) { + timeoutid = setTimeout(() => { + emitTyping(!!textarea.val()); + timeoutid = 0; + }, 5000); + } + }); }; Chats.addActionHandlers = function (element, roomId) { From d7a7c3553cbc6b17bde65a5a7ff193159070d523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 6 Sep 2023 18:31:35 -0400 Subject: [PATCH 06/19] chore: up themes --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index 83dc54d8dc..0372aea609 100644 --- a/install/package.json +++ b/install/package.json @@ -102,10 +102,10 @@ "nodebb-plugin-ntfy": "1.6.1", "nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-rewards-essentials": "0.2.3", - "nodebb-theme-harmony": "1.1.52", + "nodebb-theme-harmony": "1.1.53", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", - "nodebb-theme-persona": "13.2.27", + "nodebb-theme-persona": "13.2.28", "nodebb-widget-essentials": "7.0.13", "nodemailer": "6.9.5", "nprogress": "0.2.0", From 319d3b1f3472ab6ccf7cd6c0d91fd53f36f642f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 6 Sep 2023 18:58:14 -0400 Subject: [PATCH 07/19] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 0372aea609..f670975bb3 100644 --- a/install/package.json +++ b/install/package.json @@ -102,7 +102,7 @@ "nodebb-plugin-ntfy": "1.6.1", "nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-rewards-essentials": "0.2.3", - "nodebb-theme-harmony": "1.1.53", + "nodebb-theme-harmony": "1.1.54", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", "nodebb-theme-persona": "13.2.28", From 512c44d5b74bc09891ace0a93bf5b6c1f3ce30e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 6 Sep 2023 23:29:18 -0400 Subject: [PATCH 08/19] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index f670975bb3..57560d919c 100644 --- a/install/package.json +++ b/install/package.json @@ -102,7 +102,7 @@ "nodebb-plugin-ntfy": "1.6.1", "nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-rewards-essentials": "0.2.3", - "nodebb-theme-harmony": "1.1.54", + "nodebb-theme-harmony": "1.1.55", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", "nodebb-theme-persona": "13.2.28", From 3f7de1c7a08cfc3a77ff4de07641e1a0d9bb1ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 8 Sep 2023 10:56:18 -0400 Subject: [PATCH 09/19] chore: up deps --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index 57560d919c..f113c8369a 100644 --- a/install/package.json +++ b/install/package.json @@ -93,7 +93,7 @@ "multiparty": "4.2.3", "nconf": "0.12.0", "nodebb-plugin-2factor": "7.2.1", - "nodebb-plugin-composer-default": "10.2.18", + "nodebb-plugin-composer-default": "10.2.19", "nodebb-plugin-dbsearch": "6.2.2", "nodebb-plugin-emoji": "5.1.5", "nodebb-plugin-emoji-android": "4.0.0", @@ -102,7 +102,7 @@ "nodebb-plugin-ntfy": "1.6.1", "nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-rewards-essentials": "0.2.3", - "nodebb-theme-harmony": "1.1.55", + "nodebb-theme-harmony": "1.1.56", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", "nodebb-theme-persona": "13.2.28", From 3e07c18d264f80042f9074d6c8c6fa8dbd00536e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 8 Sep 2023 11:06:24 -0400 Subject: [PATCH 10/19] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index f113c8369a..e31d03b375 100644 --- a/install/package.json +++ b/install/package.json @@ -102,7 +102,7 @@ "nodebb-plugin-ntfy": "1.6.1", "nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-rewards-essentials": "0.2.3", - "nodebb-theme-harmony": "1.1.56", + "nodebb-theme-harmony": "1.1.57", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", "nodebb-theme-persona": "13.2.28", From 5c628c566afedb47542529a91b4697ef7d7dc929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 8 Sep 2023 12:52:17 -0400 Subject: [PATCH 11/19] chore: up composer/persona --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index e31d03b375..343a33795a 100644 --- a/install/package.json +++ b/install/package.json @@ -93,7 +93,7 @@ "multiparty": "4.2.3", "nconf": "0.12.0", "nodebb-plugin-2factor": "7.2.1", - "nodebb-plugin-composer-default": "10.2.19", + "nodebb-plugin-composer-default": "10.2.20", "nodebb-plugin-dbsearch": "6.2.2", "nodebb-plugin-emoji": "5.1.5", "nodebb-plugin-emoji-android": "4.0.0", @@ -105,7 +105,7 @@ "nodebb-theme-harmony": "1.1.57", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", - "nodebb-theme-persona": "13.2.28", + "nodebb-theme-persona": "13.2.29", "nodebb-widget-essentials": "7.0.13", "nodemailer": "6.9.5", "nprogress": "0.2.0", From 62afd0bdd66b97d69ac9e95f93ae8b265a05de2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 8 Sep 2023 14:13:32 -0400 Subject: [PATCH 12/19] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 343a33795a..e57c71d5f9 100644 --- a/install/package.json +++ b/install/package.json @@ -102,7 +102,7 @@ "nodebb-plugin-ntfy": "1.6.1", "nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-rewards-essentials": "0.2.3", - "nodebb-theme-harmony": "1.1.57", + "nodebb-theme-harmony": "1.1.58", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", "nodebb-theme-persona": "13.2.29", From 46f260b5031fe0de63ab329021096e5be0f67879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 10 Sep 2023 19:28:53 -0400 Subject: [PATCH 13/19] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index e57c71d5f9..b1ef772f25 100644 --- a/install/package.json +++ b/install/package.json @@ -102,7 +102,7 @@ "nodebb-plugin-ntfy": "1.6.1", "nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-rewards-essentials": "0.2.3", - "nodebb-theme-harmony": "1.1.58", + "nodebb-theme-harmony": "1.1.59", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", "nodebb-theme-persona": "13.2.29", From bd94f2632a9a3c22c3f31f41e541d96e627100ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 10 Sep 2023 19:45:07 -0400 Subject: [PATCH 14/19] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index b1ef772f25..c01476aaf2 100644 --- a/install/package.json +++ b/install/package.json @@ -102,7 +102,7 @@ "nodebb-plugin-ntfy": "1.6.1", "nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-rewards-essentials": "0.2.3", - "nodebb-theme-harmony": "1.1.59", + "nodebb-theme-harmony": "1.1.60", "nodebb-theme-lavender": "7.1.3", "nodebb-theme-peace": "2.1.18", "nodebb-theme-persona": "13.2.29", From 53106c009c39e38bdd93089ba65f28744252c03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 11 Sep 2023 10:20:10 -0400 Subject: [PATCH 15/19] fix: toMid to posts you cant see --- src/messaging/create.js | 9 ++++++-- src/messaging/data.js | 3 +++ test/messaging.js | 51 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 59 insertions(+), 4 deletions(-) diff --git a/src/messaging/create.js b/src/messaging/create.js index 81da98d0d6..f40002b801 100644 --- a/src/messaging/create.js +++ b/src/messaging/create.js @@ -42,8 +42,13 @@ module.exports = function (Messaging) { if (!roomData) { throw new Error('[[error:no-room]]'); } - if (data.toMid && !utils.isNumber(data.toMid)) { - throw new Error('[[error:invalid-mid]]'); + if (data.toMid) { + if (!utils.isNumber(data.toMid)) { + throw new Error('[[error:invalid-mid]]'); + } + if (!await Messaging.canViewMessage(data.toMid, roomId, uid)) { + throw new Error('[[error:no-privileges]]'); + } } const mid = await db.incrObjectField('global', 'nextMid'); const timestamp = data.timestamp || Date.now(); diff --git a/src/messaging/data.js b/src/messaging/data.js index e6466f579c..20568cc3f7 100644 --- a/src/messaging/data.js +++ b/src/messaging/data.js @@ -132,6 +132,9 @@ module.exports = function (Messaging) { return; } parentMids = _.uniq(parentMids); + const canView = await Messaging.canViewMessage(parentMids, roomId, uid); + parentMids = parentMids.filter((mid, idx) => canView[idx]); + const parentMessages = await Messaging.getMessagesFields(parentMids, [ 'fromuid', 'content', 'timestamp', 'deleted', ]); diff --git a/test/messaging.js b/test/messaging.js index 395d0f8764..53ae9eb67c 100644 --- a/test/messaging.js +++ b/test/messaging.js @@ -1,7 +1,6 @@ 'use strict'; const assert = require('assert'); -const async = require('async'); const request = require('request-promise-native'); const nconf = require('nconf'); const util = require('util'); @@ -369,7 +368,6 @@ describe('Messaging Library', () => { }); it('should fail to send second message due to rate limit', async () => { - const socketMock = { uid: mocks.users.foo.uid }; const oldValue = meta.config.chatMessageDelay; meta.config.chatMessageDelay = 1000; @@ -572,6 +570,55 @@ describe('Messaging Library', () => { }); }); + describe('toMid', () => { + let roomId; + let firstMid; + before(async () => { + // create room + const { body } = await callv3API('post', `/chats`, { + uids: [mocks.users.bar.uid], + }, 'foo'); + roomId = body.response.roomId; + // send message + const result = await callv3API('post', `/chats/${roomId}`, { + roomId: roomId, + message: 'first chat message', + }, 'foo'); + + firstMid = result.body.response.mid; + }); + + it('should fail if toMid is not a number', async () => { + const result = await callv3API('post', `/chats/${roomId}`, { + roomId: roomId, + message: 'invalid', + toMid: 'osmaosd', + }, 'foo'); + assert.strictEqual(result.body.status.message, 'Invalid Chat Message ID'); + }); + + it('should reply to firstMid using toMid', async () => { + const { body } = await callv3API('post', `/chats/${roomId}`, { + roomId: roomId, + message: 'invalid', + toMid: firstMid, + }, 'bar'); + assert(body.response.mid); + }); + + it('should fail if user can not view toMid', async () => { + // add new user + await callv3API('post', `/chats/${roomId}/users`, { uids: [mocks.users.herp.uid] }, 'foo'); + // try to reply to firstMid that this user cant see + const { body } = await callv3API('post', `/chats/${roomId}`, { + roomId: roomId, + message: 'invalid', + toMid: firstMid, + }, 'herp'); + assert.strictEqual(body.status.message, 'You do not have enough privileges for this action.'); + }); + }); + describe('edit/delete', () => { const socketModules = require('../src/socket.io/modules'); let mid; From 6625116634d631df486b16caee7aa324daa1fb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 11 Sep 2023 10:29:53 -0400 Subject: [PATCH 16/19] test: fix room count --- test/messaging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/messaging.js b/test/messaging.js index 53ae9eb67c..df88236044 100644 --- a/test/messaging.js +++ b/test/messaging.js @@ -813,7 +813,7 @@ describe('Messaging Library', () => { assert.equal(response.statusCode, 200); assert(Array.isArray(body.rooms)); - assert.equal(body.rooms.length, 2); + assert.equal(body.rooms.length, 3); assert.equal(body.title, '[[pages:chats]]'); }); From 9dc9d5ef542d58ff38d69bcb085cb26bd519ab26 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 11 Sep 2023 14:27:14 -0400 Subject: [PATCH 17/19] test: remove errant .only() --- test/user/reset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/user/reset.js b/test/user/reset.js index 36f80b2dda..a2c1d631cd 100644 --- a/test/user/reset.js +++ b/test/user/reset.js @@ -112,7 +112,7 @@ describe('Password reset (library methods)', () => { }); }); -describe.only('locks', () => { +describe('locks', () => { let uid; let email; beforeEach(async () => { From e1bced8c2c2c552165708a2814971dcb32d7613c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 11 Sep 2023 14:22:04 -0400 Subject: [PATCH 18/19] fix: move database call used to associate a NodeBB session UUID to its express session id into user.auth.addSession, which is the only time it is called --- src/controllers/authentication.js | 5 +---- src/user/auth.js | 7 +++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 08515f1124..82eec9f566 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -379,15 +379,12 @@ authenticationController.onSuccessfulLogin = async function (req, uid) { new Promise((resolve) => { req.session.save(resolve); }), - user.auth.addSession(uid, req.sessionID), + user.auth.addSession(uid, req.sessionID, uuid), user.updateLastOnlineTime(uid), user.onUserOnline(uid, Date.now()), analytics.increment('logins'), db.incrObjectFieldBy('global', 'loginCount', 1), ]); - if (uid > 0) { - await db.setObjectField(`uid:${uid}:sessionUUID:sessionId`, uuid, req.sessionID); - } // Force session check for all connected socket.io clients with the same session id sockets.in(`sess_${req.sessionID}`).emit('checkSession', uid); diff --git a/src/user/auth.js b/src/user/auth.js index d8113547e6..5330903a15 100644 --- a/src/user/auth.js +++ b/src/user/auth.js @@ -106,12 +106,15 @@ module.exports = function (User) { await db.sortedSetRemove(`uid:${uid}:sessions`, expiredSids); } - User.auth.addSession = async function (uid, sessionId) { + User.auth.addSession = async function (uid, sessionId, uuid) { if (!(parseInt(uid, 10) > 0)) { return; } await cleanExpiredSessions(uid); - await db.sortedSetAdd(`uid:${uid}:sessions`, Date.now(), sessionId); + await Promise.all([ + db.sortedSetAdd(`uid:${uid}:sessions`, Date.now(), sessionId), + db.setObjectField(`uid:${uid}:sessionUUID:sessionId`, uuid, sessionId), + ]); await revokeSessionsAboveThreshold(uid, meta.config.maxUserSessions); }; From 6bc2b6c5ae1249309abbe52acffcee83e9380f5e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 11 Sep 2023 15:10:37 -0400 Subject: [PATCH 19/19] fix(deps): bump 2factor --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index c01476aaf2..67e579e57f 100644 --- a/install/package.json +++ b/install/package.json @@ -92,7 +92,7 @@ "mousetrap": "1.6.5", "multiparty": "4.2.3", "nconf": "0.12.0", - "nodebb-plugin-2factor": "7.2.1", + "nodebb-plugin-2factor": "7.2.2", "nodebb-plugin-composer-default": "10.2.20", "nodebb-plugin-dbsearch": "6.2.2", "nodebb-plugin-emoji": "5.1.5", @@ -194,4 +194,4 @@ "url": "https://github.com/barisusakli" } ] -} \ No newline at end of file +}