@saltcorn/server 0.7.4 → 0.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.js +18 -11
- package/auth/admin.js +370 -120
- package/auth/roleadmin.js +5 -23
- package/auth/routes.js +40 -15
- package/locales/de.json +1049 -273
- package/locales/en.json +58 -3
- package/locales/es.json +134 -134
- package/locales/it.json +6 -1
- package/locales/ru.json +44 -7
- package/markup/admin.js +46 -42
- package/markup/forms.js +4 -3
- package/package.json +8 -7
- package/public/blockly.js +19 -31
- package/public/diagram_utils.js +530 -0
- package/public/gridedit.js +4 -1
- package/public/jquery-menu-editor.min.js +112 -112
- package/public/saltcorn-common.js +31 -8
- package/public/saltcorn.css +11 -0
- package/public/saltcorn.js +211 -70
- package/restart_watcher.js +1 -0
- package/routes/actions.js +6 -14
- package/routes/admin.js +229 -79
- package/routes/api.js +19 -2
- package/routes/common_lists.js +137 -134
- package/routes/delete.js +6 -5
- package/routes/diagram.js +43 -117
- package/routes/edit.js +5 -10
- package/routes/fields.js +63 -29
- package/routes/files.js +137 -101
- package/routes/homepage.js +2 -2
- package/routes/infoarch.js +2 -2
- package/routes/list.js +12 -13
- package/routes/page.js +16 -3
- package/routes/pageedit.js +13 -8
- package/routes/scapi.js +1 -1
- package/routes/search.js +1 -1
- package/routes/tables.js +9 -14
- package/routes/tag_entries.js +31 -10
- package/routes/tags.js +10 -10
- package/routes/tenant.js +114 -50
- package/routes/utils.js +12 -0
- package/routes/view.js +3 -4
- package/routes/viewedit.js +57 -55
- package/serve.js +5 -0
- package/tests/admin.test.js +6 -2
- package/tests/auth.test.js +20 -0
- package/tests/fields.test.js +1 -0
- package/tests/files.test.js +11 -20
- package/tests/tenant.test.js +12 -2
- package/tests/viewedit.test.js +15 -1
package/app.js
CHANGED
|
@@ -122,12 +122,10 @@ const getApp = async (opts = {}) => {
|
|
|
122
122
|
app.use(passport.initialize());
|
|
123
123
|
app.use(passport.authenticate(["jwt", "session"]));
|
|
124
124
|
app.use((req, res, next) => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
next();
|
|
130
|
-
});
|
|
125
|
+
// no jwt and session id at the same time
|
|
126
|
+
if (!(jwt_extractor(req) && req.cookies && req.cookies["connect.sid"]))
|
|
127
|
+
next();
|
|
128
|
+
});
|
|
131
129
|
app.use(flash());
|
|
132
130
|
|
|
133
131
|
//static serving
|
|
@@ -170,6 +168,15 @@ const getApp = async (opts = {}) => {
|
|
|
170
168
|
}
|
|
171
169
|
)
|
|
172
170
|
);
|
|
171
|
+
app.use(
|
|
172
|
+
`/static_assets/${version_tag}`,
|
|
173
|
+
express.static(
|
|
174
|
+
path.dirname(require.resolve("@saltcorn/filemanager/package.json")) + "/public/build",
|
|
175
|
+
{
|
|
176
|
+
maxAge: development_mode ? 0 : "100d",
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
);
|
|
173
180
|
|
|
174
181
|
passport.use(
|
|
175
182
|
"local",
|
|
@@ -248,7 +255,7 @@ const getApp = async (opts = {}) => {
|
|
|
248
255
|
};
|
|
249
256
|
if (
|
|
250
257
|
db.is_it_multi_tenant() &&
|
|
251
|
-
jwt_payload.tenant?.length > 0 &&
|
|
258
|
+
jwt_payload.tenant?.length > 0 &&
|
|
252
259
|
jwt_payload.tenant !== db.connectObj.default_schema
|
|
253
260
|
) {
|
|
254
261
|
return await db.runWithTenant(jwt_payload.tenant, userCheck);
|
|
@@ -341,13 +348,13 @@ Sitemap: ${base}sitemap.xml
|
|
|
341
348
|
<urlset
|
|
342
349
|
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
343
350
|
${urls
|
|
344
|
-
|
|
345
|
-
|
|
351
|
+
.map(
|
|
352
|
+
(url) => `<url>
|
|
346
353
|
<loc>${url}</loc>
|
|
347
354
|
<lastmod>${now}</lastmod>
|
|
348
355
|
</url>`
|
|
349
|
-
|
|
350
|
-
|
|
356
|
+
)
|
|
357
|
+
.join("")}
|
|
351
358
|
|
|
352
359
|
</urlset>`);
|
|
353
360
|
})
|