|
|
@ -39,7 +39,7 @@ define([
|
|
|
|
var getSecrets = function (Cryptpad, Utils, cb) {
|
|
|
|
var getSecrets = function (Cryptpad, Utils, cb) {
|
|
|
|
var hash = window.location.hash.slice(1);
|
|
|
|
var hash = window.location.hash.slice(1);
|
|
|
|
var secret = Utils.Hash.getSecrets('drive', hash);
|
|
|
|
var secret = Utils.Hash.getSecrets('drive', hash);
|
|
|
|
if (hash) {
|
|
|
|
if (hash && Utils.LocalStore.isLoggedIn()) {
|
|
|
|
// Add a shared folder!
|
|
|
|
// Add a shared folder!
|
|
|
|
// TODO password?
|
|
|
|
// TODO password?
|
|
|
|
Cryptpad.addSharedFolder(secret, function (id) {
|
|
|
|
Cryptpad.addSharedFolder(secret, function (id) {
|
|
|
@ -53,6 +53,16 @@ define([
|
|
|
|
cb(null, secret);
|
|
|
|
cb(null, secret);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
} else if (hash) {
|
|
|
|
|
|
|
|
var id = Utils.Util.createRandomInteger();
|
|
|
|
|
|
|
|
window.CryptPad_newSharedFolder = id;
|
|
|
|
|
|
|
|
var data = {
|
|
|
|
|
|
|
|
href: Utils.Hash.getRelativeHref(window.location.href),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Cryptpad.loadSharedFolder(id, data, function () {
|
|
|
|
|
|
|
|
cb(null, secret);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// No password for drive
|
|
|
|
// No password for drive
|
|
|
|
cb(null, secret);
|
|
|
|
cb(null, secret);
|
|
|
|