1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-12-18 08:27:03 +02:00

Encode secret

This commit is contained in:
Piero Toffanin 2024-07-16 15:59:33 -04:00
parent c827d442ec
commit 8ba054c786

View File

@ -41,7 +41,7 @@ document.addEventListener('DOMContentLoaded', function(){
filesTranslation: true, filesTranslation: true,
frontendTimeout: 500, frontendTimeout: 500,
apiSecret: atob("{{ api_secret }}") apiSecret: "{{ api_secret }}"
}, },
mounted: function() { mounted: function() {
const self = this; const self = this;
@ -244,7 +244,7 @@ document.addEventListener('DOMContentLoaded', function(){
data.append("format", self.isHtml ? "html" : "text"); data.append("format", self.isHtml ? "html" : "text");
data.append("alternatives", 3); data.append("alternatives", 3);
data.append("api_key", localStorage.getItem("api_key") || ""); data.append("api_key", localStorage.getItem("api_key") || "");
if (self.apiSecret) data.append("secret", self.apiSecret); if (self.apiSecret) data.append("secret", atob(self.apiSecret));
request.open('POST', BaseUrl + '/translate', true); request.open('POST', BaseUrl + '/translate', true);