From 3bf59574d5efd6f000d5f6aef91227212782975f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 12 Oct 2023 21:15:06 +0200 Subject: [PATCH] Remove remains of http-basic-auth-cred --- nodes/http-auth.js | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/nodes/http-auth.js b/nodes/http-auth.js index caac187..d122e3f 100644 --- a/nodes/http-auth.js +++ b/nodes/http-auth.js @@ -50,9 +50,9 @@ module.exports = function (RED) { let src = 'inline'; let realm = config.realm.trim(); let realmL = realm.toLowerCase(); - let username = config.username.trim(); - let usernameL = username.toLowerCase(); - let password = config.password; + const username = config.username.trim(); + const usernameL = username.toLowerCase(); + const password = config.password; let getUser = function (_realm, _username) { if (_realm.trim().toLowerCase() === realmL && _username.trim().toLowerCase() === usernameL) { return { @@ -64,14 +64,12 @@ module.exports = function (RED) { return null; }; - const cred = RED.nodes.getNode(config.cred); - if (cred) { - src = 'cred'; - realm = cred.realm.trim(); + const multiple = RED.nodes.getNode(config.multiple); + if (multiple) { + src = 'multiple'; + realm = multiple.realm.trim(); realmL = realm.toLowerCase(); - username = cred.username.trim(); - usernameL = username.toLowerCase(); - password = cred.password; + getUser = multiple.getUser; } const file = RED.nodes.getNode(config.file); @@ -82,14 +80,6 @@ module.exports = function (RED) { getUser = file.getUser; } - const multiple = RED.nodes.getNode(config.multiple); - if (multiple) { - src = 'multiple'; - realm = multiple.realm.trim(); - realmL = realm.toLowerCase(); - getUser = multiple.getUser; - } - this.httpauthconf = {}; this.httpauthconf.src = src; this.httpauthconf.realm = realm;