fix: remove public access from do space and generate signed url wherever PDF files are accessed

This commit is contained in:
prafull-opensignlabs
2024-04-05 21:21:19 +05:30
parent 6c16d00031
commit 3659a1de55
24 changed files with 237 additions and 33 deletions
@@ -0,0 +1,17 @@
import getPresignedUrl from './getSignedUrl.js';
async function UserAfterFind(request) {
if (request.objects.length === 1) {
if (request.objects) {
const obj = request.objects[0];
const ProfilePic = obj?.get('ProfilePic') && obj?.get('ProfilePic');
if (ProfilePic) {
obj.set('ProfilePic', getPresignedUrl(ProfilePic));
}
return [obj];
}
}
}
export default UserAfterFind;