mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-26 16:07:13 +00:00
tweak: endpoints are authorized by default
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user