@saltcorn/server 0.6.3-beta.3 → 0.6.4-beta.3

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 CHANGED
@@ -28,6 +28,7 @@ const {
28
28
  getSessionStore,
29
29
  setTenant,
30
30
  } = require("./routes/utils.js");
31
+ const { getAllTenants } = require("@saltcorn/admin-models/models/tenant");
31
32
  const path = require("path");
32
33
  const fileUpload = require("express-fileupload");
33
34
  const helmet = require("helmet");
@@ -84,7 +85,8 @@ const getApp = async (opts = {}) => {
84
85
  app.use(i18n.init);
85
86
  // init multitenant mode
86
87
  if (db.is_it_multi_tenant()) {
87
- await init_multi_tenant(loadAllPlugins, opts.disableMigrate);
88
+ const tenants = await getAllTenants();
89
+ await init_multi_tenant(loadAllPlugins, opts.disableMigrate, tenants);
88
90
  }
89
91
  //
90
92
  // todo ability to configure session_secret Age
package/auth/resetpw.js CHANGED
@@ -8,9 +8,9 @@ const { getMailTransport } = require("@saltcorn/data/models/email");
8
8
  const { get_base_url } = require("../routes/utils");
9
9
 
10
10
  /**
11
- * @param {string} link
12
- * @param {object} user
13
- * @param {object} req
11
+ * @param {string} link
12
+ * @param {object} user
13
+ * @param {object} req
14
14
  * @returns {void}
15
15
  */
16
16
  const generate_email = (link, user, req) => ({
@@ -48,8 +48,8 @@ ${req.__(
48
48
  });
49
49
 
50
50
  /**
51
- * @param {object} user
52
- * @param {object} req
51
+ * @param {object} user
52
+ * @param {object} req
53
53
  * @returns {Promise<void>}
54
54
  */
55
55
  const send_reset_email = async (user, req) => {
@@ -59,8 +59,8 @@ const send_reset_email = async (user, req) => {
59
59
  };
60
60
 
61
61
  /**
62
- * @param {object} user
63
- * @param {object} req
62
+ * @param {object} user
63
+ * @param {object} req
64
64
  * @returns {Promise<string>}
65
65
  */
66
66
  const get_reset_link = async (user, req) => {
package/auth/routes.js CHANGED
@@ -53,7 +53,7 @@ const Table = require("@saltcorn/data/models/table");
53
53
  const { InvalidConfiguration } = require("@saltcorn/data/utils");
54
54
  const Trigger = require("@saltcorn/data/models/trigger");
55
55
  const { restore_backup } = require("../markup/admin.js");
56
- const { restore } = require("@saltcorn/data/models/backup");
56
+ const { restore } = require("@saltcorn/admin-models/models/backup");
57
57
  const load_plugins = require("../load_plugins");
58
58
  const fs = require("fs");
59
59
  const base32 = require("thirty-two");