mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-26 14:01:16 -07:00
Change: just require auth for MCP
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { getServerSession } from "next-auth/next";
|
||||
|
||||
import { authOptions } from "pages/api/auth/[...nextauth]";
|
||||
import { handleMcpRequest, mcpAuthorized, mcpEnabled } from "utils/mcp/homepage-mcp";
|
||||
import { handleMcpRequest, mcpEnabled, mcpTokenAuthorized } from "utils/mcp/homepage-mcp";
|
||||
|
||||
async function hasHomepageSession(req, res) {
|
||||
if (!process.env.HOMEPAGE_AUTH_ENABLED) return false;
|
||||
@@ -13,7 +13,7 @@ export default async function handler(req, res) {
|
||||
return res.status(404).end("Not Found");
|
||||
}
|
||||
|
||||
if (!mcpAuthorized(req) && !(await hasHomepageSession(req, res))) {
|
||||
if (!mcpTokenAuthorized(req) && !(await hasHomepageSession(req, res))) {
|
||||
return res.status(401).json({ error: "Unauthorized" });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user