Fix an issue when trying to create a pad with a password from a template

pull/1/head
yflory 7 years ago
parent f218a9c119
commit ef735d6fe6

@ -438,7 +438,7 @@ define([
optsGet.password = password; optsGet.password = password;
}), href); }), href);
} }
if (parsed2.hashData && parsed2.hashData.password) { if (parsed2.hashData && parsed2.hashData.password && !optsPut.password) {
common.getPadAttribute('password', waitFor(function (err, password) { common.getPadAttribute('password', waitFor(function (err, password) {
optsPut.password = password; optsPut.password = password;
})); }));

@ -766,10 +766,11 @@ define([
// Pass rtConfig to useTemplate because Cryptput will create the file and // Pass rtConfig to useTemplate because Cryptput will create the file and
// we need to have the owners and expiration time in the first line on the // we need to have the owners and expiration time in the first line on the
// server // server
var cryptputCfg = $.extend(true, {}, rtConfig, {password: password});
Cryptpad.useTemplate(data.template, Cryptget, function () { Cryptpad.useTemplate(data.template, Cryptget, function () {
startRealtime(); startRealtime();
cb(); cb();
}, rtConfig); }, cryptputCfg);
return; return;
} }
// Start realtime outside the iframe and callback // Start realtime outside the iframe and callback

Loading…
Cancel
Save