Normalize the credentials presence check
Most places that check for the presence / absence of credentials compare them against `undefined`, except the one for Plain authentication. This change makes the very last place to use the same pattern (instead of checking for falsiness) for consistency. Additionally, there are ways to configure PAM to accept empty passwords, so it's possible for a user to legitimately send an empty string as password.
This commit is contained in:
parent
18593154d3
commit
0c55c64757
|
@ -1427,8 +1427,8 @@ export default class RFB extends EventTargetMixin {
|
||||||
|
|
||||||
// negotiated Plain subtype, server waits for password
|
// negotiated Plain subtype, server waits for password
|
||||||
if (this._rfbVeNCryptState == 4) {
|
if (this._rfbVeNCryptState == 4) {
|
||||||
if (!this._rfbCredentials.username ||
|
if (this._rfbCredentials.username === undefined ||
|
||||||
!this._rfbCredentials.password) {
|
this._rfbCredentials.password === undefined) {
|
||||||
this.dispatchEvent(new CustomEvent(
|
this.dispatchEvent(new CustomEvent(
|
||||||
"credentialsrequired",
|
"credentialsrequired",
|
||||||
{ detail: { types: ["username", "password"] } }));
|
{ detail: { types: ["username", "password"] } }));
|
||||||
|
|
Loading…
Reference in New Issue