Skip to content

Commit

Permalink
fix(conn): password can be set when username unset when mqttv5
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMoen committed Dec 19, 2023
1 parent 0d4144d commit 944c85b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion writeToStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function connect (packet, stream, opts) {

// Password
if (password != null) {
if (!providedUsername) {
if (!providedUsername && protocolVersion !== 5) {
stream.destroy(new Error('Username is required to use password'))
return false
}
Expand Down

0 comments on commit 944c85b

Please sign in to comment.