Keypair not initialised correctly in the answers channel

- Bug introduced in #1316 to fix #1261
- Was an issue when creating a new form (impossible to answer), however
  importing a template fixed it.
- priv should stay in the scope of initializeAnswers() and not leak
This commit is contained in:
Fabrice Mouhartem 2023-11-28 11:11:59 +01:00
parent 51abbb484f
commit e31965abb3

View file

@ -4519,6 +4519,7 @@ define([
if (!APP.isEditor) { return; }
if (content.answers && content.answers.channel && content.answers.publicKey && content.answers.validateKey) { return; }
// Don't override other settings (anonymous, makeAnonymous, etc.) from templates
var priv = metadataMgr.getPrivateData();
content.answers = content.answers || {};
content.answers.channel = Hash.createChannelId();
content.answers.publicKey = priv.form_public;