[mirotalk] - fix: show clear rate-limit message on login page when max attempts exceeded
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
# ====================================================
|
||||
# MiroTalk P2P v.1.7.50 - Environment Configuration
|
||||
# MiroTalk P2P v.1.7.51 - Environment Configuration
|
||||
# ====================================================
|
||||
|
||||
# App environment
|
||||
|
||||
@@ -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.
|
||||
|
||||
+4
-2
@@ -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),
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -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": {
|
||||
|
||||
+1
-1
@@ -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: `
|
||||
<button
|
||||
id="support-button"
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
* @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
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -13738,7 +13738,7 @@ function showAbout() {
|
||||
Swal.fire({
|
||||
background: swBg,
|
||||
position: 'center',
|
||||
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.7.50',
|
||||
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.7.51',
|
||||
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
|
||||
customClass: { image: 'img-about' },
|
||||
html: `
|
||||
|
||||
+7
-1
@@ -73,7 +73,13 @@ function login() {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error(error);
|
||||
popup('warning', 'Invalid credentials. Please try again.');
|
||||
const status = error.response ? error.response.status : 0;
|
||||
const serverMsg = error.response && error.response.data ? error.response.data.message : '';
|
||||
if (status === 429 && serverMsg) {
|
||||
popup('warning', serverMsg);
|
||||
} else {
|
||||
popup('warning', 'Invalid credentials. Please try again.');
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user