From 53d5b7907068a892c089ae38eb0a7840c09d0239 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Sun, 26 Jan 2025 09:50:50 +0100 Subject: [PATCH] [mirotalk] - fix user_auth --- .env.template | 2 +- app/src/server.js | 8 ++++---- package.json | 4 ++-- public/js/client.js | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env.template b/.env.template index f38f26bf..7ce61700 100644 --- a/.env.template +++ b/.env.template @@ -54,7 +54,7 @@ SESSION_SECRET='mirotalk-p2p-oidc-secret' HOST_PROTECTED=false # true or false HOST_USER_AUTH=false # true or false -HOST_USERS='[{"username": "username", "password": "password"},{"username": "username2", "password": "password2"}]' +HOST_USERS='[{"username": "admin", "password": "admin"},{"username": "guest", "password": "guest"}]' # JWT token config diff --git a/app/src/server.js b/app/src/server.js index 428b88b6..d60efd4c 100755 --- a/app/src/server.js +++ b/app/src/server.js @@ -39,7 +39,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.4.61 + * @version 1.4.62 * */ @@ -650,10 +650,10 @@ app.get('/join/*', function (req, res) { // Login app.get(['/login'], (req, res) => { - if (!hostCfg.protected) { - return res.redirect('/'); + if (hostCfg.protected || hostCfg.user_auth) { + return res.sendFile(views.login); } - res.sendFile(views.login); + res.redirect('/'); }); // Logged diff --git a/package.json b/package.json index 27db83c2..aef0152b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalk", - "version": "1.4.61", + "version": "1.4.62", "description": "A free WebRTC browser-based video call", "main": "server.js", "scripts": { @@ -58,7 +58,7 @@ "js-yaml": "^4.1.0", "ngrok": "^5.0.0-beta.2", "nodemailer": "^6.10.0", - "openai": "^4.80.0", + "openai": "^4.80.1", "qs": "^6.14.0", "socket.io": "^4.8.1", "swagger-ui-express": "^5.0.1", diff --git a/public/js/client.js b/public/js/client.js index 4fe39d3a..6265b857 100644 --- a/public/js/client.js +++ b/public/js/client.js @@ -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.4.61 + * @version 1.4.62 * */ @@ -1268,7 +1268,7 @@ function handleUnauthorized() { allowEscapeKey: false, background: swBg, imageUrl: images.forbidden, - title: 'Oops, Unauthorized', + title: 'Ops, Unauthorized', text: 'The host has user authentication enabled', confirmButtonText: `Login`, showClass: { popup: 'animate__animated animate__fadeInDown' }, @@ -11039,7 +11039,7 @@ function showAbout() { Swal.fire({ background: swBg, position: 'center', - title: 'WebRTC P2P v1.4.61', + title: 'WebRTC P2P v1.4.62', imageAlt: 'mirotalk-about', imageUrl: images.about, customClass: { image: 'img-about' },