feat(auth): add authentication middleware to export controller

This commit is contained in:
Jakub Trávník
2025-12-23 00:26:37 +01:00
parent 630b34ee10
commit dc5c88efcd

View File

@@ -18,6 +18,7 @@ import {
type SecretsMode,
type FullExportBody,
} from "./config-export.dto";
import { requireAuth } from "../auth/auth.middleware";
const COOKIE_NAME = "session_id";
const COOKIE_OPTIONS = {
@@ -175,11 +176,13 @@ function transformBackupSchedules(
});
}
export const configExportController = new Hono().post(
"/export",
fullExportDto,
validator("json", fullExportBodySchema),
async (c) => {
export const configExportController = new Hono()
.use(requireAuth)
.post(
"/export",
fullExportDto,
validator("json", fullExportBodySchema),
async (c) => {
try {
const body = c.req.valid("json") as FullExportBody;