mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
Fix integration upload issues
This commit is contained in:
parent
de46da0e7a
commit
8bf37704d5
@ -487,7 +487,7 @@ const factory = (Sortify, UserObject, ProxyManager,
|
||||
var initTempRpc = (clientId, cb) => {
|
||||
if (store.rpc) { return void cb(store.rpc); }
|
||||
var kp = Crypto.Nacl.sign.keyPair();
|
||||
var keys = {
|
||||
var keys = store.tempKeys = {
|
||||
edPublic: Util.encodeBase64(kp.publicKey),
|
||||
edPrivate: Util.encodeBase64(kp.secretKey)
|
||||
};
|
||||
@ -3228,6 +3228,10 @@ const factory = (Sortify, UserObject, ProxyManager,
|
||||
if (obj?.error) {
|
||||
Feedback.send("NO_DRIVE_ERROR", true);
|
||||
}
|
||||
if (!!data.neverDrive) {
|
||||
// Send temp RPC keys to the browser to allow upload
|
||||
obj.tempKeys = store?.tempKeys;
|
||||
}
|
||||
cb(obj);
|
||||
}, !!data.neverDrive);
|
||||
}
|
||||
|
||||
@ -48,6 +48,8 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
const Env = {};
|
||||
|
||||
// Upgrade and donate URLs duplicated in pages.js
|
||||
var origin = encodeURIComponent(window.location.hostname);
|
||||
var common = window.Cryptpad = {
|
||||
@ -79,6 +81,12 @@ define([
|
||||
common.getAccessKeys = function (cb) {
|
||||
var keys = [];
|
||||
nThen(function (waitFor) {
|
||||
// Not logged in? check for temp RPC keys
|
||||
if (!LocalStore.isLoggedIn() && Env?.returned?.tempKeys) {
|
||||
keys.push(Env.returned.tempKeys);
|
||||
return;
|
||||
}
|
||||
|
||||
// Push account keys
|
||||
postMessage("GET", {
|
||||
key: ['edPrivate'],
|
||||
@ -2736,6 +2744,7 @@ define([
|
||||
|
||||
console.log('Posting CONNECT');
|
||||
postMessage('CONNECT', cfg, function (data) {
|
||||
Env.returned = data;
|
||||
// FIXME data should always exist
|
||||
// this indicates a false condition in sharedWorker
|
||||
// got here via a reference error:
|
||||
|
||||
2
www/common/worker.bundle.min.js
vendored
2
www/common/worker.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user