Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit ff497e7

Browse files
committed
More generic empty check for process envs
1 parent b4681bb commit ff497e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

persistence/persistence-elastic/persist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ const password = process.env["ELASTICSEARCH_PASSWORD"];
1010
const apiKeyId = process.env["ELASTICSEARCH_APIKEY_ID"];
1111
const apiKey = process.env["ELASTICSEARCH_APIKEY"];
1212

13-
if (apiKeyId !== "" && apiKey !== "") {
13+
if (apiKeyId && apiKey) {
1414
console.log("Using API Key for Authentication");
1515
authParams.auth = {
1616
id: apiKeyId,
1717
api_key: apiKey,
1818
};
19-
} else if (username !== "" && password !== "") {
19+
} else if (username && password) {
2020
console.log("Using Username/Password for Authentication");
2121
authParams.auth = {
2222
username,

0 commit comments

Comments
 (0)