fix(app): required auth was in wrong spot caused entire app to want you logged in
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { type Express, Router } from "express";
|
||||
import type { Express } from "express";
|
||||
import { requireAuth } from "../middleware/auth.middleware.js";
|
||||
import { featureCheck } from "../middleware/featureActive.middleware.js";
|
||||
|
||||
@@ -6,15 +6,11 @@ import getApt from "./opendockGetRelease.route.js";
|
||||
|
||||
export const setupOpendockRoutes = (baseUrl: string, app: Express) => {
|
||||
//setup all the routes
|
||||
// Apply auth to entire router
|
||||
const router = Router();
|
||||
|
||||
// is the feature even on?
|
||||
router.use(featureCheck("opendock_sync"));
|
||||
|
||||
// we need to make sure we are authenticated to see the releases
|
||||
router.use(requireAuth);
|
||||
|
||||
router.use(getApt);
|
||||
app.use(`${baseUrl}/api/opendock`, router);
|
||||
app.use(
|
||||
`${baseUrl}/api/opendock`,
|
||||
featureCheck("opendock_sync"),
|
||||
requireAuth,
|
||||
getApt,
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user