Inline auth for custom nodes

This commit is contained in:
HenryNguyen5 2018-02-02 17:21:14 -05:00
parent b39b36d0dc
commit 6157208557
1 changed files with 9 additions and 7 deletions

View File

@ -348,16 +348,18 @@ class CustomNodeModal extends React.Component<Props, State> {
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 };
}