Merge pull request #1318 from chrisjdev/emptyPassword

Allow connecting with empty string credentials
This commit is contained in:
Samuel Mannehed 2019-12-05 12:15:43 +01:00 committed by GitHub
commit b39caa7469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

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