Hidden hash for shared folders and team invitation

This commit is contained in:
yflory
2020-01-27 13:34:41 +01:00
parent 0ad96e0966
commit a8e6250576
3 changed files with 30 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ define([
var requireConfig = RequireConfig();
// Loaded in load #2
var hash, href;
nThen(function (waitFor) {
DomReady.onReady(waitFor());
}).nThen(function (waitFor) {
@@ -19,6 +20,14 @@ define([
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
// Hidden hash
hash = window.location.hash;
href = window.location.href;
if (window.history && window.history.replaceState) {
window.history.replaceState({}, window.document.title, '#');
}
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/teams/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
@@ -37,7 +46,6 @@ define([
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) {
var teamId;
var hash = window.location.hash.slice(1);
var addRpc = function (sframeChan, Cryptpad) {
sframeChan.on('Q_SET_TEAM', function (data, cb) {
teamId = data;
@@ -95,7 +103,7 @@ define([
};
var addData = function (meta) {
if (!hash) { return; }
meta.teamInviteHash = hash;
meta.teamInviteHash = hash.slice(1);
};
SFCommonO.start({
getSecrets: getSecrets,