Skip to content

Commit 83e4985

Browse files
committed
Don't display API keys and tokens on endpoint update - they shouldn't be visible after configuration
1 parent 21d44d4 commit 83e4985

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

view/adminhtml/web/js/log-endpoints.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,16 @@ define([
341341
}
342342

343343
const formElements = document.forms['create-log-endpoint-form'].elements;
344+
// Inputs which should be available only on endpoint creation and shouldn't be used on update, such as API keys
345+
const createLogInputs = ['access_key', 'secret_key', 'token', 'sas_token'];
344346
for (const prop in endpoint) {
345347
let element = formElements.namedItem(`log_endpoint[${prop}]`);
346348
if (element) {
347-
$(element).val(endpoint[prop]);
349+
if (createLogInputs.includes(prop) && endpoint[prop]) {
350+
$(element).remove()
351+
} else {
352+
$(element).val(endpoint[prop]);
353+
}
348354
}
349355
}
350356
}

0 commit comments

Comments
 (0)