Fix: use strict bool check for auth

This commit is contained in:
shamoon
2026-08-07 07:51:21 -07:00
parent 670d0a8e40
commit b33c88dba1
4 changed files with 17 additions and 3 deletions
+2 -1
View File
@@ -1,10 +1,11 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "pages/api/auth/[...nextauth]";
import { isAuthEnabled } from "utils/env";
import { handleMcpRequest, mcpEnabled, mcpTokenAuthorized } from "utils/mcp/homepage-mcp";
async function hasHomepageSession(req, res) {
if (!process.env.HOMEPAGE_AUTH_ENABLED) return false;
if (!isAuthEnabled()) return false;
return Boolean(await getServerSession(req, res, authOptions));
}