feat: Apply authentication middleware globally (#7396)

* feat: Apply auth middleware globally

* feat: Remove local auth middleware where it makes sense
This commit is contained in:
Stevche Radevski
2024-05-27 15:24:53 +02:00
committed by GitHub
parent 62ef82f497
commit 10ef32c5a3
52 changed files with 76 additions and 276 deletions
@@ -11,16 +11,10 @@ import {
} from "./validators"
import { MiddlewareRoute } from "../../../loaders/helpers/routing/types"
import { authenticate } from "../../../utils/middlewares/authenticate-middleware"
import { validateAndTransformBody } from "../../utils/validate-body"
import { validateAndTransformQuery } from "../../utils/validate-query"
export const adminCustomerRoutesMiddlewares: MiddlewareRoute[] = [
{
method: ["ALL"],
matcher: "/admin/customers*",
middlewares: [authenticate("user", ["bearer", "session", "api-key"])],
},
{
method: ["GET"],
matcher: "/admin/customers",