refactor: change variable from isDisableOTP to isEnableOTP

This commit is contained in:
prafull-opensignlabs
2024-09-18 14:32:45 +05:30
parent cc11848346
commit 4caf9f598a
28 changed files with 156 additions and 73 deletions
@@ -32,7 +32,7 @@ export default async function GenerateCertificate(docDetails) {
const OriginIp = docDetails?.OriginIp || '';
const company = docDetails?.ExtUserPtr?.Company || '';
const createdAt = docDetails?.DocSentAt?.iso || docDetails.createdAt;
const isDisableOTP = docDetails?.IsDisableOTP || false;
const IsEnableOTP = docDetails?.IsEnableOTP || false;
const auditTrail =
docDetails?.Signers?.length > 0
? docDetails.AuditTrail.map(x => {
@@ -349,7 +349,7 @@ export default async function GenerateCertificate(docDetails) {
font: timesRomanFont,
color: textValueColor,
});
if (!isDisableOTP) {
if (IsEnableOTP) {
page.drawText('Security level :', {
x: half + 55,
y: yPosition4 + 10,
@@ -286,9 +286,9 @@ async function PDF(req) {
if (!resDoc) {
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Document not found.');
}
const IsDisableOTP = resDoc?.get('IsDisableOTP') || false;
// if `IsDisableOTP` is true then we don't have to check authentication
if (!IsDisableOTP) {
const IsEnableOTP = resDoc?.get('IsEnableOTP') || false;
// if `IsEnableOTP` is false then we don't have to check authentication
if (IsEnableOTP) {
if (!req?.user) {
throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'User is not authenticated.');
}