spec-3nweb-server 1.8.2 → 1.8.4

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.
Files changed (2) hide show
  1. package/build/main.js +13 -4
  2. package/package.json +1 -1
package/build/main.js CHANGED
@@ -146,9 +146,9 @@ async function displaySignupInfo(conf) {
146
146
  }
147
147
  else {
148
148
  console.log(`Signup of users is allowed only with valid signup tokens.\n`);
149
- if (conf.signup.serviceUrl) {
150
- console.log(`Signup service url (from configuration file):\n`, conf.signup.serviceUrl, `\n`);
151
- }
149
+ }
150
+ if (conf.signup.serviceUrl) {
151
+ console.log(`Signup service url (from configuration file):\n`, conf.signup.serviceUrl, `\n`);
152
152
  }
153
153
  }
154
154
  const { multiUserTokens, singleUserTokens } = await (0, signup_1.readAllSignupTokens)(conf.rootFolder);
@@ -213,6 +213,7 @@ async function displayTokenValue(conf, tokenId) {
213
213
  process.exit(-1);
214
214
  }
215
215
  }
216
+ const signupLinkStart = `w3n://signup/`;
216
217
  function signupLinkFrom(conf, token = '') {
217
218
  var _a;
218
219
  if (!((_a = conf.signup) === null || _a === void 0 ? void 0 : _a.serviceUrl)) {
@@ -220,7 +221,7 @@ function signupLinkFrom(conf, token = '') {
220
221
  }
221
222
  try {
222
223
  const url = new URL(conf.signup.serviceUrl);
223
- return `3nweb://signup/${url.host}${url.pathname}${url.pathname.endsWith('/') ? '' : '/'}${token}`;
224
+ return `${signupLinkStart}${url.host}${url.pathname}${url.pathname.endsWith('/') ? '' : '/'}${token}`;
224
225
  }
225
226
  catch (err) {
226
227
  return;
@@ -229,10 +230,18 @@ function signupLinkFrom(conf, token = '') {
229
230
  async function createMultiUserToken(conf, domains) {
230
231
  const token = await (0, signup_1.addMultiDomainSignup)(conf.rootFolder, domains);
231
232
  console.log(`\nToken value:\n ${token}\n`);
233
+ const signupLink = signupLinkFrom(conf, token);
234
+ if (signupLink) {
235
+ console.log(`Signup link: ${signupLink}\n`);
236
+ }
232
237
  }
233
238
  async function createSingleUserToken(conf, userId) {
234
239
  const token = await (0, signup_1.addSingleUserSignup)(conf.rootFolder, userId);
235
240
  console.log(`\nToken value:\n ${token}\n`);
241
+ const signupLink = signupLinkFrom(conf, token);
242
+ if (signupLink) {
243
+ console.log(`Signup link: ${signupLink}\n`);
244
+ }
236
245
  }
237
246
  const cmd = (0, cli_1.parseProcessArgv)();
238
247
  if (cmd.runCmd) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-3nweb-server",
3
- "version": "1.8.2",
3
+ "version": "1.8.4",
4
4
  "description": "3NWeb spec server.",
5
5
  "main": "build/lib.js",
6
6
  "types": "build/lib.d.ts",