Skip to content

Commit f843a86

Browse files
committed
chore: comment mqtt-v5 username/password
1 parent 944c85b commit f843a86

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

writeToStream.js

+2
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ function connect (packet, stream, opts) {
201201
// Password
202202
if (password != null) {
203203
if (!providedUsername && protocolVersion !== 5) {
204+
// `username` is not required when password is present in MQTT-v5
205+
// see also: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901044
204206
stream.destroy(new Error('Username is required to use password'))
205207
return false
206208
}

0 commit comments

Comments
 (0)