mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-24 08:32:34 +02:00
fix: remove public access from do space and generate signed url wherever PDF files are accessed
This commit is contained in:
+4
-4
@@ -11,7 +11,7 @@ const serverUrl = process.env.SERVER_URL,
|
||||
async function uploadFile(e, a) {
|
||||
try {
|
||||
var t = fs.readFileSync(a),
|
||||
s = new Parse.File(e, [...t]),
|
||||
s = new Parse.File(e, [...t], 'application/pdf'),
|
||||
r = (await s.save({ useMasterKey: !0 }), s.url());
|
||||
return { imageUrl: r };
|
||||
} catch (e) {
|
||||
@@ -111,11 +111,11 @@ async function sendDoctoWebhook(t, e, a, s) {
|
||||
}),
|
||||
a.save(null, { useMasterKey: !0 });
|
||||
} catch (e) {
|
||||
console.log('err save in contracts_Webhook', e);
|
||||
console.log('err save in contracts_Webhook', e.message);
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
console.log('Err send data to webhook', e);
|
||||
console.log('Err send data to webhook', e.message);
|
||||
try {
|
||||
var a = new Parse.Object('contracts_Webhook');
|
||||
a.set('Log', e?.status),
|
||||
@@ -126,7 +126,7 @@ async function sendDoctoWebhook(t, e, a, s) {
|
||||
}),
|
||||
a.save(null, { useMasterKey: !0 });
|
||||
} catch (e) {
|
||||
console.log('err save in contracts_Webhook', e);
|
||||
console.log('err save in contracts_Webhook', e.message);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user