24 files changed
+11
-596
No files matched your search
+1
-5
@@ -21,7 +21,6 @@ const PROTECTED_PREFIXES = ["/staff", "/owner"];
|
||||
// business data guard themselves (see /api/health and
|
||||
// /api/cron/process-notifications).
|
||||
const INSTALL_EXEMPT_PREFIXES = [
|
||||
"/manager",
|
||||
"/install",
|
||||
"/offline",
|
||||
"/manifest.webmanifest",
|
||||
@@ -91,10 +90,7 @@ export default auth(async (req) => {
|
||||
const isInstallExempt = INSTALL_EXEMPT_PREFIXES.some(
|
||||
(prefix) => pathname === prefix || pathname.startsWith(prefix.endsWith("/") ? prefix : `${prefix}/`),
|
||||
);
|
||||
// The platform Manager is a separate deployment and deliberately has no
|
||||
// business database. Its own session guard runs inside /manager pages/API.
|
||||
const isManagerPath = pathname === "/manager" || pathname.startsWith("/manager/");
|
||||
const installed = isManagerPath ? true : await isInstalledForRequest();
|
||||
const installed = await isInstalledForRequest();
|
||||
|
||||
if (!installed && !isInstallExempt) {
|
||||
const response = NextResponse.redirect(new URL("/install", req.nextUrl.origin));
|
||||
|
||||
Reference in new issue
Block a user