Skip to content

Commit 221f71c

Browse files
Merge pull request #685 from OpenSignLabs/guestsign_url
fix: x is not defined error in createDocumentWithTemplate and createDocumentwithCoordinate function
2 parents 9ba05d2 + a26e65f commit 221f71c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,13 @@ export default async function createDocumentWithTemplate(request, response) {
317317
properties: { response_code: 200 },
318318
});
319319
}
320-
//encode this url value `${res.id}/${x.email}/${x.contactPtr.objectId}` to base64 using `btoa` function
321-
const encodeBase64 = btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`);
322320
return response.json({
323321
objectId: res.id,
324322
signurl: contact.map(x => ({
325323
email: x.email,
326-
url: `${baseUrl.origin}/login/${encodeBase64}`,
324+
url: `${baseUrl.origin}/login/${btoa(
325+
`${res.id}/${x.email}/${x.contactPtr.objectId}`
326+
)}`,
327327
})),
328328
message: 'Document sent successfully!',
329329
});

apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,11 @@ export default async function createDocumentwithCoordinate(request, response) {
361361
properties: { response_code: 200 },
362362
});
363363
}
364-
//encode this url value `${res.id}/${x.email}/${x.contactPtr.objectId}` to base64 using `btoa` function
365-
const encodeBase64 = btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`);
366364
return response.json({
367365
objectId: res.id,
368366
signurl: contact.map(x => ({
369367
email: x.email,
370-
url: `${baseUrl.origin}/login/${encodeBase64}`,
368+
url: `${baseUrl.origin}/login/${btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`)}`,
371369
})),
372370
message: 'Document sent successfully!',
373371
});

0 commit comments

Comments
 (0)