mirror of
https://github.com/gethomepage/homepage.git
synced 2026-10-19 00:41:45 -07:00
Refactor: auth architecture (#7256)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { withAuth } from "utils/auth";
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
import createLogger from "utils/logger";
|
||||
import { formatApiCall } from "utils/proxy/api-helpers";
|
||||
@@ -41,7 +42,7 @@ function getSafeSegments(rawSegments, allowedSegments) {
|
||||
return safeSegments;
|
||||
}
|
||||
|
||||
export default async function handler(req, res) {
|
||||
async function handler(req, res) {
|
||||
try {
|
||||
const { service, group, index } = req.query;
|
||||
const serviceWidget = await getServiceWidget(group, service, index);
|
||||
@@ -144,3 +145,5 @@ export default async function handler(req, res) {
|
||||
return res.status(500).send({ error: "Unexpected error" });
|
||||
}
|
||||
}
|
||||
|
||||
export default withAuth(handler);
|
||||
|
||||
Reference in New Issue
Block a user