From 6ea5bca68e56a1c954aa01d5331f3621f79755e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Cesar=20Laura=20Avenda=C3=B1o?= Date: Tue, 8 Oct 2024 22:07:36 +0000 Subject: [PATCH] FOUR-19236 Encryption is Not Working in Authenticated Web Entry --- src/components/renderer/form-masked-input.vue | 21 +++++++------------ src/main.js | 4 ++-- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/components/renderer/form-masked-input.vue b/src/components/renderer/form-masked-input.vue index fa208d7f5..d23b01012 100644 --- a/src/components/renderer/form-masked-input.vue +++ b/src/components/renderer/form-masked-input.vue @@ -244,13 +244,6 @@ export default { componentConfigComputed() { return JSON.parse(JSON.stringify(this.componentConfig)); }, - requestId() { - const node = document.head.querySelector(`meta[name="request-id"]`); - if (node === null) { - return null; - } - return node.content; - }, mode() { return this.$root.$children[0].mode; }, @@ -258,7 +251,7 @@ export default { return this.mode === 'preview' && window.exampleScreens !== undefined; }, inPreviewMode() { - return this.mode === 'preview' && this.requestId === null; + return this.mode === 'preview'; }, }, watch: { @@ -412,15 +405,15 @@ export default { if (this.inStandAloneMode || !this.inPreviewMode) { // Build data to send const dataToEncrypt = { - request_id: this.requestId, + uuid: uuidValidate(this.value) ? this.value : null, field_name: this.name, plain_text: this.localValue, - screen_id: this.$root.task?.screen?.screen_id + screen_id: this.$root.task?.screen?.screen_id || window?.PM4ConfigOverrides?.authParams?.screen_id }; // Call endpoint to encrypt data window.ProcessMaker.apiClient - .post("encrypted_data/encryptText", dataToEncrypt) + .post("/api/1.0/encrypted_data/encryptText", dataToEncrypt) .then((response) => { const v = response?.data !== undefined ? response?.data : response; this.afterEncrypt(v); @@ -444,14 +437,14 @@ export default { if (this.inStandAloneMode || !this.inPreviewMode) { // Build data to send const dataToDecrypt = { - request_id: this.requestId, + uuid: this.value, field_name: this.name, - screen_id: this.$root.task?.screen?.screen_id + screen_id: this.$root.task?.screen?.screen_id || window?.PM4ConfigOverrides?.authParams?.screen_id }; // Call endpoint to decrypt data window.ProcessMaker.apiClient - .post("encrypted_data/decryptText", dataToDecrypt) + .post("/api/1.0/encrypted_data/decryptText", dataToDecrypt) .then((response) => { const v = response?.data !== undefined ? response?.data : response; this.afterDecrypt(v); diff --git a/src/main.js b/src/main.js index 30d8b8fd7..e2658e501 100644 --- a/src/main.js +++ b/src/main.js @@ -253,10 +253,10 @@ window.ProcessMaker = { } }); break; - case "encrypted_data/encryptText": + case "/api/1.0/encrypted_data/encryptText": resolve("62abf17e-d1a6-4f68-a382-ed63872d29b0"); break; - case "encrypted_data/decryptText": + case "/api/1.0/encrypted_data/decryptText": resolve("Secret Value"); break; default: