Merge pull request #676 from OpenSignLabs/guestsign_url

fix: issue of url encoded parameter in guest login url
This commit is contained in:
prafull-opensignlabs
2024-05-07 18:53:27 +05:30
committed by GitHub
8 changed files with 76 additions and 50 deletions
@@ -217,9 +217,10 @@ export default async function createDocumentWithTemplate(request, response) {
};
const objectId = contactMail[i].contactPtr.objectId;
const hostUrl = baseUrl.origin;
let signPdf = `${hostUrl}/login/${res.id}/${contactMail[i].email}/${objectId}/${serverParams}`;
//encode this url value `${res.id}/${contactMail[i].email}/${objectId}` to base64 using `btoa` function
const encodeBase64 = btoa(`${res.id}/${contactMail[i].email}/${objectId}`);
let signPdf = `${hostUrl}/login/${encodeBase64}`;
const openSignUrl = 'https://www.opensignlabs.com/contact-us';
const orgName = template.ExtUserPtr.Company ? template.ExtUserPtr.Company : '';
const themeBGcolor = '#47a3ad';
@@ -316,11 +317,13 @@ export default async function createDocumentWithTemplate(request, response) {
properties: { response_code: 200 },
});
}
//encode this url value `${res.id}/${x.email}/${x.contactPtr.objectId}` to base64 using `btoa` function
const encodeBase64 = btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`);
return response.json({
objectId: res.id,
signurl: contact.map(x => ({
email: x.email,
url: `${baseUrl.origin}/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`,
url: `${baseUrl.origin}/login/${encodeBase64}`,
})),
message: 'Document sent successfully!',
});
@@ -278,7 +278,9 @@ export default async function createDocumentwithCoordinate(request, response) {
const objectId = contactMail[i].contactPtr.objectId;
const hostUrl = baseUrl.origin;
let signPdf = `${hostUrl}/login/${res.id}/${contactMail[i].email}/${objectId}/${serverParams}`;
//encode this url value `${response.id}/${contactMail[i].email}/${objectId}` to base64 using `btoa` function
const encodeBase64 = btoa(`${response.id}/${contactMail[i].email}/${objectId}`);
let signPdf = `${hostUrl}/login/${encodeBase64}`;
const openSignUrl = 'https://www.opensignlabs.com/contact-us';
const orgName = parseExtUser.Company ? parseExtUser.Company : '';
const themeBGcolor = '#47a3ad';
@@ -359,11 +361,13 @@ export default async function createDocumentwithCoordinate(request, response) {
properties: { response_code: 200 },
});
}
//encode this url value `${res.id}/${x.email}/${x.contactPtr.objectId}` to base64 using `btoa` function
const encodeBase64 = btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`);
return response.json({
objectId: res.id,
signurl: contact.map(x => ({
email: x.email,
url: `${baseUrl.origin}/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`,
url: `${baseUrl.origin}/login/${encodeBase64}`,
})),
message: 'Document sent successfully!',
});