Skip to content

Commit

Permalink
fix: Add login check on /download-schema route (#4222)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Jan 29, 2025
1 parent 9227ee2 commit b567663
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api.planx.uk/modules/flows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ paths:
summary: Download flow schema
description: Download a CSV file representing the flow's schema
tags: ["flows"]
security:
- bearerAuth: []
parameters:
- $ref: "#/components/parameters/flowId"
responses:
Expand Down
7 changes: 6 additions & 1 deletion api.planx.uk/modules/flows/routes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Router } from "express";
import { validate } from "../../shared/middleware/validate.js";
import { usePlatformAdminAuth, useTeamEditorAuth } from "../auth/middleware.js";
import {
useLoginAuth,
usePlatformAdminAuth,
useTeamEditorAuth,
} from "../auth/middleware.js";
import { copyFlowController, copyFlowSchema } from "./copyFlow/controller.js";
import {
copyFlowAsPortalSchema,
Expand Down Expand Up @@ -73,6 +77,7 @@ router.post(

router.get(
"/flows/:flowId/download-schema",
useLoginAuth,
validate(downloadFlowSchema),
downloadFlowSchemaController,
);
Expand Down

0 comments on commit b567663

Please sign in to comment.