]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Allow connecting with empty string credentials
authorChris J <chrisjdev@users.noreply.github.com>
Thu, 7 Nov 2019 20:15:15 +0000 (15:15 -0500)
committerSamuel Mannehed <samuel@cendio.se>
Thu, 5 Dec 2019 11:13:11 +0000 (12:13 +0100)
Checking for undefined instead of falsy. That way an empty strings are allowed.

core/rfb.js

index dfcab7c69e4116210532cf96950727b095b7db1f..9ef369d6d60a9ec2d82e4335b4dd40dfc42f70bc 100644 (file)
@@ -940,9 +940,9 @@ export default class RFB extends EventTargetMixin {
 
     // authentication
     _negotiate_xvp_auth() {
-        if (!this._rfb_credentials.username ||
-            !this._rfb_credentials.password ||
-            !this._rfb_credentials.target) {
+        if (this._rfb_credentials.username === undefined ||
+            this._rfb_credentials.password === undefined ||
+            this._rfb_credentials.target === undefined) {
             this.dispatchEvent(new CustomEvent(
                 "credentialsrequired",
                 { detail: { types: ["username", "password", "target"] } }));
@@ -961,7 +961,7 @@ export default class RFB extends EventTargetMixin {
     _negotiate_std_vnc_auth() {
         if (this._sock.rQwait("auth challenge", 16)) { return false; }
 
-        if (!this._rfb_credentials.password) {
+        if (this._rfb_credentials.password === undefined) {
             this.dispatchEvent(new CustomEvent(
                 "credentialsrequired",
                 { detail: { types: ["password"] } }));