From 01d4514deed5e61d849c6f720b6f165a88f2e106 Mon Sep 17 00:00:00 2001 From: Chris J Date: Thu, 7 Nov 2019 15:15:15 -0500 Subject: [PATCH] Allow connecting with empty string credentials Checking for undefined instead of falsy. That way an empty strings are allowed. --- core/rfb.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/rfb.js b/core/rfb.js index dfcab7c6..9ef369d6 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -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"] } }));