Refactor: auth architecture (#7256)

This commit is contained in:
shamoon
2026-10-16 22:09:09 -07:00
committed by GitHub
parent 89b0d20655
commit 9628256887
48 changed files with 638 additions and 127 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
import fs from "fs";
import path from "path";
import { withAuth } from "utils/auth";
import { CONF_DIR } from "utils/config/config";
import createLogger from "utils/logger";
@@ -10,7 +11,7 @@ const logger = createLogger("configFileService");
* @param {import("next").NextApiRequest} req
* @param {import("next").NextApiResponse} res
*/
export default async function handler(req, res) {
async function handler(req, res) {
const { path: relativePath } = req.query;
// only two supported files, for now
@@ -32,3 +33,5 @@ export default async function handler(req, res) {
return res.status(500).end("Internal Server Error");
}
}
export default withAuth(handler, { public: (req) => req.query?.path === "custom.css" });