mirror of
https://github.com/gethomepage/homepage.git
synced 2026-10-16 23:41:45 -07:00
Refactor: auth architecture (#7256)
This commit is contained in:
@@ -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" });
|
||||
|
||||
Reference in New Issue
Block a user