From c65f17a2162fdc8cf449dc0d37c92f18731a3814 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Wed, 13 Nov 2024 16:20:17 +0530 Subject: [PATCH] fix: otp auth must be disable in certificate if OTP verfication is off --- .../parsefunction/pdf/GenerateCertificate.js | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/apps/OpenSignServer/cloud/parsefunction/pdf/GenerateCertificate.js b/apps/OpenSignServer/cloud/parsefunction/pdf/GenerateCertificate.js index d9f33c1a7..0f0e98f30 100644 --- a/apps/OpenSignServer/cloud/parsefunction/pdf/GenerateCertificate.js +++ b/apps/OpenSignServer/cloud/parsefunction/pdf/GenerateCertificate.js @@ -458,17 +458,17 @@ export default async function GenerateCertificate(docDetails) { }); currentPage.drawText('Viewed on :', { - x: half, + x: half + 55, y: yPosition2, - size: text, + size: timeText, font: timesRomanFont, color: textKeyColor, }); currentPage.drawText(`${new Date(x.ViewedOn).toUTCString()}`, { - x: half + 75, + x: half + 112, y: yPosition2, - size: text, + size: timeText, font: timesRomanFont, color: textValueColor, }); @@ -490,17 +490,17 @@ export default async function GenerateCertificate(docDetails) { }); currentPage.drawText('Signed on :', { - x: half, - y: yPosition3, - size: text, + x: half + 55, + y: yPosition3 + 5, + size: timeText, font: timesRomanFont, color: textKeyColor, }); currentPage.drawText(`${new Date(x.SignedOn).toUTCString()}`, { - x: half + 70, - y: yPosition3, - size: text, + x: half + 108, + y: yPosition3 + 5, + size: timeText, font: timesRomanFont, color: textValueColor, }); @@ -520,22 +520,23 @@ export default async function GenerateCertificate(docDetails) { font: timesRomanFont, color: textValueColor, }); - currentPage.drawText('Security level :', { - x: half, - y: yPosition4, - size: text, - font: timesRomanFont, - color: textKeyColor, - }); - - currentPage.drawText(`Email, OTP Auth`, { - x: half + 90, - y: yPosition4, - size: text, - font: timesRomanFont, - color: textValueColor, - }); + if (IsEnableOTP) { + currentPage.drawText('Security level :', { + x: half + 55, + y: yPosition4 + 10, + size: timeText, + font: timesRomanFont, + color: textKeyColor, + }); + currentPage.drawText(`Email, OTP Auth`, { + x: half + 125, + y: yPosition4 + 10, + size: timeText, + font: timesRomanFont, + color: textValueColor, + }); + } currentPage.drawText('Signature :', { x: 30, y: yPosition5,