mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-30 11:49:45 +02:00
fix: remove public access from do space and generate signed url wherever PDF files are accessed
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import getPresignedUrl from './getSignedUrl.js';
|
||||
|
||||
async function SignatureAfterFind(request) {
|
||||
if (request.objects.length === 1) {
|
||||
if (request.objects) {
|
||||
const obj = request.objects[0];
|
||||
const ImageURL = obj?.get('ImageURL') && obj?.get('ImageURL');
|
||||
const Initials = obj?.get('Initials') && obj?.get('Initials');
|
||||
|
||||
if (ImageURL) {
|
||||
obj.set('ImageURL', getPresignedUrl(ImageURL));
|
||||
}
|
||||
|
||||
if (Initials) {
|
||||
obj.set('Initials', getPresignedUrl(Initials));
|
||||
}
|
||||
|
||||
return [obj];
|
||||
}
|
||||
}
|
||||
}
|
||||
export default SignatureAfterFind;
|
||||
Reference in New Issue
Block a user