mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-04-19 06:18:12 -04:00
feat(auth): add authentication middleware to export controller
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user