From f17faefb30e4872688a1c0dafcc6c793242750f4 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Fri, 4 Dec 2020 20:56:48 +0100 Subject: plugins: add optional authentication for routes --- server/controllers/plugins.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/controllers/plugins.ts') diff --git a/server/controllers/plugins.ts b/server/controllers/plugins.ts index 18c6613e2..6a1ccc0bf 100644 --- a/server/controllers/plugins.ts +++ b/server/controllers/plugins.ts @@ -9,6 +9,7 @@ import { getCompleteLocale, is18nLocale } from '../../shared/core-utils/i18n' import { PluginType } from '../../shared/models/plugins/plugin.type' import { isTestInstance } from '../helpers/core-utils' import { logger } from '@server/helpers/logger' +import { optionalAuthenticate } from '@server/middlewares/oauth' const sendFileOptions = { maxAge: '30 days', @@ -45,11 +46,13 @@ pluginsRouter.get('/plugins/:pluginName/:pluginVersion/client-scripts/:staticEnd pluginsRouter.use('/plugins/:pluginName/router', getPluginValidator(PluginType.PLUGIN, false), + optionalAuthenticate, servePluginCustomRoutes ) pluginsRouter.use('/plugins/:pluginName/:pluginVersion/router', getPluginValidator(PluginType.PLUGIN), + optionalAuthenticate, servePluginCustomRoutes ) -- cgit v1.2.3