@r2d2bzh/moleculer-authz-helpers 0.0.3 → 0.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2d2bzh/moleculer-authz-helpers",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Moleculer mixin to implement preflight runner",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -35,7 +35,7 @@ export const unsafeAddPreflightMixin = (serviceSchema) => {
35
35
 
36
36
  export default (serviceSchema) => {
37
37
  Object.entries(serviceSchema.actions || {})
38
- .filter(([, actionSpecification]) => actionSpecification?.rest?.authorization !== false)
38
+ .filter(([, actionSpecification]) => actionSpecification?.rest && actionSpecification.rest?.authorization !== false)
39
39
  .forEach(([actionName, actionSpecification]) => {
40
40
  if (!(actionSpecification?.preflight instanceof Function || actionSpecification?.preflight?.handler)) {
41
41
  throw new MoleculerError('missing preflight handler', 500, 'MISSING_PREFLIGHT', { actionName });