Skip to content

Commit

Permalink
Check for authentication obj before delete operation #1415 (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahanaFarooqui authored Jun 20, 2024
1 parent b6dbd23 commit c54edca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions backend/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ export class CommonService {
return obj;
};
this.removeAuthSecureData = (node) => {
delete node.authentication.macaroonPath;
delete node.authentication.runePath;
delete node.authentication.runeValue;
delete node.authentication.lnApiPassword;
delete node.authentication.options;
if (node.authentication) {
delete node.authentication.macaroonPath;
delete node.authentication.runePath;
delete node.authentication.runeValue;
delete node.authentication.lnApiPassword;
delete node.authentication.options;
}
return node;
};
this.removeSecureData = (config) => {
Expand Down
12 changes: 7 additions & 5 deletions server/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ export class CommonService {
};

public removeAuthSecureData = (node: SelectedNode) => {
delete node.authentication.macaroonPath;
delete node.authentication.runePath;
delete node.authentication.runeValue;
delete node.authentication.lnApiPassword;
delete node.authentication.options;
if (node.authentication) {
delete node.authentication.macaroonPath;
delete node.authentication.runePath;
delete node.authentication.runeValue;
delete node.authentication.lnApiPassword;
delete node.authentication.options;
}
return node;
};

Expand Down

0 comments on commit c54edca

Please sign in to comment.