Prevent Overwite of configured creds

This commit is contained in:
Ben Hardill 2021-07-16 08:47:30 +01:00
parent 81f0fb3c74
commit 32dd186f4d
No known key found for this signature in database
GPG Key ID: 74DD076979ABB1E7
1 changed files with 3 additions and 2 deletions

View File

@ -206,10 +206,11 @@ module.exports = function(RED) {
}
}
var parsedURL = new URL(url)
if (parsedURL.username) {
this.credentials = this.credentials || {}
if (parsedURL.username && !this.credentials.user) {
this.credentials.user = parsedURL.username
}
if (parsedURL.password) {
if (parsedURL.password && !this.credentials.password) {
this.credentials.password = parsedURL.password
}
if (Object.keys(this.credentials).length != 0) {