Archived
1
0

Authenticate plugin routes (#2720)

This commit is contained in:
Asher
2021-02-12 14:56:39 -06:00
committed by GitHub
parent 97c1399401
commit 619934dc29
2 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ import { plural } from "../../common/util"
import { AuthType, DefaultedArgs } from "../cli"
import { rootPath } from "../constants"
import { Heart } from "../heart"
import { redirect, replaceTemplates } from "../http"
import { ensureAuthenticated, redirect, replaceTemplates } from "../http"
import { PluginAPI } from "../plugin"
import { getMediaMime, paths } from "../util"
import { wrapper } from "../wrapper"
@ -119,7 +119,7 @@ export const register = async (
const pluginApi = new PluginAPI(logger, process.env.CS_PLUGIN, process.env.CS_PLUGIN_PATH, workingDir)
await pluginApi.loadPlugins()
pluginApi.mount(app, wsApp)
app.use("/api/applications", apps.router(pluginApi))
app.use("/api/applications", ensureAuthenticated, apps.router(pluginApi))
wrapper.onDispose(() => pluginApi.dispose())
}