@live-change/security-service 0.9.194 → 0.9.195

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/package.json +5 -5
  2. package/secured.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/security-service",
3
- "version": "0.9.194",
3
+ "version": "0.9.195",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,10 +22,10 @@
22
22
  },
23
23
  "type": "module",
24
24
  "dependencies": {
25
- "@live-change/framework": "^0.9.194",
26
- "@live-change/pattern": "^0.9.194",
27
- "@live-change/pattern-db": "^0.9.194",
25
+ "@live-change/framework": "^0.9.195",
26
+ "@live-change/pattern": "^0.9.195",
27
+ "@live-change/pattern-db": "^0.9.195",
28
28
  "nodemailer": "^6.7.2"
29
29
  },
30
- "gitHead": "40d47cf397b45ca1f1fa888d4d85727376b2b0c0"
30
+ "gitHead": "9f61eddae56ddd89aba20988b8e208d948728496"
31
31
  }
package/secured.js CHANGED
@@ -34,7 +34,7 @@ definition.processor(function(service, app) {
34
34
 
35
35
  if(bans.find(ban => ban.type == 'block')) {
36
36
  /// TODO: report security violation if failed
37
- throw 'securityBlock'
37
+ throw app.logicError("securityBlock")
38
38
  }
39
39
 
40
40
  if(bans.find(ban => ban.type == 'delay')) {
@@ -65,11 +65,11 @@ definition.processor(function(service, app) {
65
65
  const { client, ...otherProperties } = properties
66
66
  const bans = await getBans(client, actions)
67
67
 
68
- if(bans.find(ban => ban.type == 'block')) throw 'securityBlock'
68
+ if(bans.find(ban => ban.type == 'block')) throw app.logicError("securityBlock")
69
69
 
70
70
  if(bans.find(ban => ban.type == 'block')) {
71
71
  /// TODO: report security violation if failed
72
- throw 'securityBlock'
72
+ throw app.logicError("securityBlock")
73
73
  }
74
74
 
75
75
  if(bans.find(ban => ban.type == 'delay')) {