Fixed sandbox. Multiple tabs work now.

WiP on selectable mosaico templates.

TODO: Make files always point to trusted URL, such that we don't have to rebase them. They are public anyway. The same goes for mosaico endpoints: /mosaico/templates and /mosaico/img
This commit is contained in:
Tomas Bures 2018-05-09 04:07:01 +02:00
parent a4ee1534cc
commit 7788b0bc67
79 changed files with 724 additions and 390 deletions

View file

@ -2,12 +2,18 @@
import mailtrainConfig from "mailtrainConfig";
let restrictedAccessToken = 'ANONYMOUS';
function setRestrictedAccessToken(token) {
restrictedAccessToken = token;
}
function getTrustedUrl(path) {
return mailtrainConfig.trustedUrlBase + (path || '');
}
function getSandboxUrl(path) {
return mailtrainConfig.sandboxUrlBase + (path || '');
return mailtrainConfig.sandboxUrlBase + restrictedAccessToken + '/' + (path || '');
}
function getUrl(path) {
@ -22,7 +28,7 @@ function getBaseDir() {
if (mailtrainConfig.trusted) {
return mailtrainConfig.trustedUrlBaseDir;
} else {
return mailtrainConfig.sandboxUrlBaseDir;
return mailtrainConfig.sandboxUrlBaseDir + 'ANONYMOUS';
}
}
@ -30,5 +36,6 @@ export {
getTrustedUrl,
getSandboxUrl,
getUrl,
getBaseDir
getBaseDir,
setRestrictedAccessToken
}