Skip to content

Commit

Permalink
chore: comment mqtt-v5 username/password
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMoen committed Dec 19, 2023
1 parent 944c85b commit f843a86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions writeToStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ function connect (packet, stream, opts) {
// Password
if (password != null) {
if (!providedUsername && protocolVersion !== 5) {
// `username` is not required when password is present in MQTT-v5
// see also: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901044
stream.destroy(new Error('Username is required to use password'))
return false
}
Expand Down

0 comments on commit f843a86

Please sign in to comment.