From 6157208557cdc1241b7aa8502c2809f194fbd933 Mon Sep 17 00:00:00 2001 From: HenryNguyen5 Date: Fri, 2 Feb 2018 17:21:14 -0500 Subject: [PATCH] Inline auth for custom nodes --- .../Header/components/CustomNodeModal.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/components/Header/components/CustomNodeModal.tsx b/common/components/Header/components/CustomNodeModal.tsx index 2ed14479..dc46b9c8 100644 --- a/common/components/Header/components/CustomNodeModal.tsx +++ b/common/components/Header/components/CustomNodeModal.tsx @@ -348,16 +348,18 @@ class CustomNodeModal extends React.Component { name: this.state.name.trim(), url, port, - network: networkId + network: networkId, + ...(this.state.hasAuth + ? { + auth: { + username: this.state.username, + password: this.state.password + } + } + : {}) }; const lib = new CustomNode(node); - if (this.state.hasAuth) { - node.auth = { - username: this.state.username, - password: this.state.password - }; - } return { ...node, lib }; }