From 15257e0d7fef588766e3d850e4d0c9ea45478435 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Tue, 17 Mar 2026 03:34:14 +0100 Subject: [PATCH] [mirotalk] - fix: show clear rate-limit message on login page when max attempts exceeded --- .env.template | 2 +- app/src/config.template.js | 2 +- app/src/server.js | 6 ++++-- package.json | 2 +- public/js/brand.js | 2 +- public/js/client.js | 4 ++-- public/js/login.js | 8 +++++++- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.env.template b/.env.template index 199ef7c7..b52dd67c 100644 --- a/.env.template +++ b/.env.template @@ -1,5 +1,5 @@ # ==================================================== -# MiroTalk P2P v.1.7.50 - Environment Configuration +# MiroTalk P2P v.1.7.51 - Environment Configuration # ==================================================== # App environment diff --git a/app/src/config.template.js b/app/src/config.template.js index e3da46e3..0e44e3ee 100644 --- a/app/src/config.template.js +++ b/app/src/config.template.js @@ -2,7 +2,7 @@ /** * ============================================== - * MiroTalk P2P v.1.7.50 - Configuration File + * MiroTalk P2P v.1.7.51 - Configuration File * ============================================== * * This file is the central configuration source. diff --git a/app/src/server.js b/app/src/server.js index 4443df65..2ead036a 100755 --- a/app/src/server.js +++ b/app/src/server.js @@ -45,7 +45,7 @@ dependencies: { * @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.7.50 + * @version 1.7.51 * */ @@ -87,7 +87,9 @@ const minBlockTime = config.host.minLoginBlockTime; // in minutes const loginLimiter = rateLimit({ windowMs: minBlockTime * 60 * 1000, // 15 minutes default max: maxAttempts, - message: 'Too many login attempts, please try again later.', + message: { + message: `Too many login attempts. Please try again after ${minBlockTime} minute${minBlockTime == 1 ? '' : 's'}.`, + }, keyGenerator: (req) => req.body?.username || getIP(req), }); diff --git a/package.json b/package.json index f31bfabb..d3738491 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalk", - "version": "1.7.50", + "version": "1.7.51", "description": "A free WebRTC browser-based video call", "main": "server.js", "scripts": { diff --git a/public/js/brand.js b/public/js/brand.js index f298584b..90fa9d9f 100644 --- a/public/js/brand.js +++ b/public/js/brand.js @@ -104,7 +104,7 @@ let brand = { }, about: { imageUrl: '../images/mirotalk-logo.gif', - title: 'WebRTC P2P v1.7.50', + title: 'WebRTC P2P v1.7.51', html: `