daveappserver 0.7.11 → 0.7.14

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/appserver.js +26 -1
  2. package/package.json +2 -2
package/appserver.js CHANGED
@@ -1,4 +1,4 @@
1
- var myVersion = "0.7.11", myProductName = "daveAppServer";
1
+ var myVersion = "0.7.14", myProductName = "daveAppServer";
2
2
 
3
3
  exports.start = startup;
4
4
  exports.notifySocketSubscribers = notifySocketSubscribers;
@@ -1309,12 +1309,37 @@ function cleanFileStats (stats) { //4/19/21 by DW
1309
1309
  }
1310
1310
  });
1311
1311
  }
1312
+ function createPendingConfirmation (callback) { //11/14/23 by DW
1313
+ const obj = {
1314
+ magicString: utils.getRandomPassword (10),
1315
+ flDeleted: false,
1316
+ when: new Date ()
1317
+ };
1318
+ addPendingConfirmation (obj, function (err) {
1319
+ if (err) {
1320
+ callback (err);
1321
+ }
1322
+ else {
1323
+ callback (undefined, obj);
1324
+ }
1325
+ });
1326
+ }
1327
+ function checkPendingConfirmation (confirmCode, callback) { //11/14/23 by DW
1328
+ findPendingConfirmation (confirmCode, function (err, item) {
1329
+ deletePendingConfirmation (item);
1330
+ callback (err); //return success or failure
1331
+ });
1332
+ }
1312
1333
 
1313
1334
  var options = undefined;
1314
1335
  if (config.flAllowWordpressIdentity) {
1315
1336
  options = {
1316
1337
  useWordpressAccount
1317
1338
  };
1339
+ if (config.flUseDatabaseForConfirmations) { //11/14/23 by DW
1340
+ options.createPendingConfirmation = createPendingConfirmation;
1341
+ options.checkPendingConfirmation = checkPendingConfirmation;
1342
+ }
1318
1343
  }
1319
1344
 
1320
1345
  const flHandled = wordpress.handleHttpRequest (theRequest, options);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "daveappserver",
3
3
  "description": "Factored code that was appearing in all my servers.",
4
- "version": "0.7.11",
4
+ "version": "0.7.14",
5
5
  "main": "appserver.js",
6
6
  "repository": {
7
7
  "type" : "git",
@@ -25,6 +25,6 @@
25
25
  "daves3": "*",
26
26
  "davehttp": "*",
27
27
  "davemail": "*",
28
- "wpidentity": "^0.4.11"
28
+ "wpidentity": "^0.4.14"
29
29
  }
30
30
  }