upgrade otplib to 12.0.1 #6912

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Mar 23, 2025 at 20:07 UTC 46e6ddb8fc264d6c244e4dee60a2b9dabb2caa62
3 files changed +3 -3
docker/Dockerfile
+1 -1
@@ -89,7 +89,7 @@ RUN cd meshcentral && npm install
89
90 # NOTE: ALL MODULES MUST HAVE A VERSION NUMBER AND THE VERSION MUST MATCH THAT USED IN meshcentral.js mainStart()
91 RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then cd meshcentral && npm install mongodb@4.13.0 saslprep@1.0.3; fi
92 -RUN if ! [ -z "$PREINSTALL_LIBS" ] && [ "$PREINSTALL_LIBS" == "true" ]; then cd meshcentral && npm install ssh2@1.16.0 semver@7.5.4 nodemailer@6.9.15 image-size@1.1.1 wildleek@2.0.0 otplib@10.2.3 yubikeyotp@0.2.0; fi
92 +RUN if ! [ -z "$PREINSTALL_LIBS" ] && [ "$PREINSTALL_LIBS" == "true" ]; then cd meshcentral && npm install ssh2@1.16.0 semver@7.5.4 nodemailer@6.9.15 image-size@1.1.1 wildleek@2.0.0 otplib@12.0.1 yubikeyotp@0.2.0; fi
93
94 EXPOSE 80 443 4433
95
meshcentral.js
+1 -1
@@ -4299,7 +4299,7 @@ function mainStart() {
4299 if (config.settings.no2factorauth !== true) {
4300 // Setup YubiKey OTP if configured
4301 if (yubikey == true) { modules.push('yubikeyotp@0.2.0'); } // Add YubiKey OTP support
4302 - if (allsspi == false) { modules.push('otplib@10.2.3'); } // Google Authenticator support (v10 supports older NodeJS versions).
4302 + if (allsspi == false) { modules.push('otplib@12.0.1'); } // Google Authenticator support (v10 supports older NodeJS versions).
4303 }
4304
4305 // Desktop multiplexor support
meshuser.js
+1 -1
@@ -3695,7 +3695,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
3695 } else if (domain.dns == null && domain.id != '') {
3696 domainName += "/" + domain.id;
3697 }
3698 - ws.send(JSON.stringify({ action: 'otpauth-request', secret: secret, url: otplib.authenticator.keyuri(encodeURIComponent(user.name), domainName, secret) }));
3698 + ws.send(JSON.stringify({ action: 'otpauth-request', secret: secret, url: otplib.authenticator.keyuri(user.name, domainName, secret) }));
3699 }
3700 break;
3701 }