);
-}
\ No newline at end of file
+}
diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx
index d53a3ac..eb258c2 100644
--- a/src/app/not-found.tsx
+++ b/src/app/not-found.tsx
@@ -1,79 +1,82 @@
import Link from "next/link";
+import type { Metadata } from "next";
+
+export const metadata: Metadata = {
+ title: "Page Not Found — Route Commerce",
+ description: "The page you are looking for could not be found. Explore the rest of Route Commerce.",
+ robots: {
+ index: false,
+ follow: false,
+ },
+};
export default function NotFound() {
return (
-
- {/* Background decorations */}
-
-
-
+
+
+
+ {/* Ambient orbs */}
+
+
+
-
- {/* 404 Illustration */}
-
-
-
-
-
-
- 📦
+
+
No. 404
+
+ {/* Large editorial numeral */}
+
+ 404
-
- 404
+
+ Off the beaten path
-
- Page not found
-
-
- Looks like this route got lost along the way. Let's get you back on track.
+
+ We searched the field, but couldn't find that page. The route may have moved or never existed.
This will remove the stop. If it has active orders, you must resolve those first.
diff --git a/src/lib/admin-permissions.ts b/src/lib/admin-permissions.ts
index 13a09c4..8e1952b 100644
--- a/src/lib/admin-permissions.ts
+++ b/src/lib/admin-permissions.ts
@@ -41,31 +41,25 @@ export async function getAdminUser(): Promise {
let sessionEmail: string | null = null;
try {
const { data: session } = await getSession();
- console.log("[admin-permissions] Full session:", JSON.stringify(session));
sessionEmail = session?.user?.email ?? null;
- console.log("[admin-permissions] Session email:", sessionEmail);
} catch (err) {
console.error("[admin-permissions] getSession() failed:", err);
return null;
}
if (!sessionEmail) {
- console.log("[admin-permissions] No session email - returning null");
return null;
}
try {
return await withPlatformAdmin(async (db) => {
- console.log("[admin-permissions] Looking for user with email:", sessionEmail.toLowerCase());
const userRows = await db
.select()
.from(adminUsers)
.where(eq(adminUsers.email, sessionEmail.toLowerCase()))
.limit(1);
- console.log("[admin-permissions] User rows found:", userRows.length, userRows);
const user = userRows[0];
if (!user) {
- console.log("[admin-permissions] User not found in admin_users");
return null;
}
@@ -83,13 +77,10 @@ export async function getAdminUser(): Promise {
.innerJoin(brands, eq(brands.id, adminUserBrands.brandId))
.where(eq(adminUserBrands.adminUserId, user.id));
- console.log("[admin-permissions] Membership rows found:", membershipRows.length, membershipRows);
-
// Brand-scoped roles (brand_admin, store_employee) require at least one brand link.
// Platform admins may have zero or more explicit links; they get cross-brand access via role.
if (membershipRows.length === 0 && role !== "platform_admin") {
// Signed in but not provisioned for any brand.
- console.log("[admin-permissions] No brand memberships for non-platform user — denying");
return null;
}