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:
parent
a4ee1534cc
commit
7788b0bc67
79 changed files with 724 additions and 390 deletions
|
@ -385,6 +385,16 @@ async function getRestrictedAccessToken(context, method, params) {
|
|||
return token;
|
||||
}
|
||||
|
||||
async function refreshRestrictedAccessToken(context, token) {
|
||||
const tokenEntry = restrictedAccessTokens.get(token);
|
||||
|
||||
if (tokenEntry && tokenEntry.userId === context.user.id) {
|
||||
tokenEntry.expires = Date.now() + 120 * 1000
|
||||
} else {
|
||||
shares.throwPermissionDenied();
|
||||
}
|
||||
}
|
||||
|
||||
async function getByRestrictedAccessToken(token) {
|
||||
const now = Date.now();
|
||||
for (const entry of restrictedAccessTokens.values()) {
|
||||
|
@ -398,6 +408,7 @@ async function getByRestrictedAccessToken(token) {
|
|||
if (tokenEntry) {
|
||||
const user = await getById(contextHelpers.getAdminContext(), tokenEntry.userId);
|
||||
user.restrictedAccessHandler = tokenEntry.handler;
|
||||
user.restrictedAccessToken = tokenEntry.token;
|
||||
|
||||
return user;
|
||||
|
||||
|
@ -425,5 +436,6 @@ module.exports = {
|
|||
resetPassword,
|
||||
getByRestrictedAccessToken,
|
||||
getRestrictedAccessToken,
|
||||
refreshRestrictedAccessToken,
|
||||
registerRestrictedAccessTokenMethod
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue