Skip to content

Commit

Permalink
[bug] Send needpassword for pdf form; For bug 70979
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Oct 16, 2024
1 parent b2ea17e commit ddd3601
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions DocService/sources/canvasservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,16 @@ async function getOutputData(ctx, cmd, outputData, key, optConn, optAdditionalOu
userPassword = await utils.decryptPassword(ctx, encryptedUserPassword);
isCorrectPassword = decryptedPassword === userPassword;
}
if(password && !isCorrectPassword && !formatChecker.isBrowserEditorFormat(originFormat)) {
let isNeedPassword = password && !isCorrectPassword;
if (isNeedPassword && formatChecker.isBrowserEditorFormat(originFormat)) {
//check pdf form
//todo check without storage
let formEditor = await storage.listObjects(ctx, key + '/Editor.bin');
isNeedPassword = 0 !== formEditor.length;
}
if (isNeedPassword) {
ctx.logger.debug("getOutputData password mismatch");
if(encryptedUserPassword) {
if (encryptedUserPassword) {
outputData.setStatus('needpassword');
outputData.setData(constants.CONVERT_PASSWORD);
} else {
Expand Down

0 comments on commit ddd3601

Please sign in to comment.