From 7569e8a7031b891208c2e42fa93144844ddd3590 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Fri, 1 Nov 2024 15:43:40 -0400 Subject: [PATCH] tweak: endpoints are authorized by default --- src/backend/src/ExtensionService.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/src/ExtensionService.js b/src/backend/src/ExtensionService.js index e6665f08d..2dd6c651f 100644 --- a/src/backend/src/ExtensionService.js +++ b/src/backend/src/ExtensionService.js @@ -1,6 +1,7 @@ const { AdvancedBase } = require("@heyputer/putility"); const BaseService = require("./services/BaseService"); const { Endpoint } = require("./util/expressutil"); +const configurable_auth = require("./middleware/configurable_auth"); class ExtensionServiceState extends AdvancedBase { constructor (...a) { @@ -19,7 +20,7 @@ class ExtensionServiceState extends AdvancedBase { // TODO: option for auth middleware is harcoded here, but eventually // all exposed middlewares should be registered under the simpele names // used in this options object (probably; still not 100% decided on that) - if ( options.auth ) { + if ( ! options.noauth ) { const auth_conf = typeof options.auth === 'object' ? options.auth : {}; mw.push(configurable_auth(auth_conf));