Skip to content

Commit 298dbb2

Browse files
author
Yoseph Maguire
authored
fix(secure): do not override password and username (mqttjs#1190)
1 parent 94075d8 commit 298dbb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/connect/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ function connect (brokerUrl, opts) {
6868
opts.host = parsed.host
6969
opts.protocol = parsed.protocol
7070
opts.port = Number(parsed.port) || null
71-
opts.username = parsed.username
72-
opts.password = parsed.password
71+
opts.username = opts.username || parsed.username
72+
opts.password = opts.password || parsed.password
7373
opts.searchParams = parsed.searchParams
7474
opts.protocol = opts.protocol.replace(/:$/, '')
7575
}

0 commit comments

Comments
 (0)