Remove coming-soon; redirect site hosts to website app.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
18b29f5b62
commit
1041ab20c5
@@ -4,12 +4,7 @@ import { useEffect } from "react";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import { useAuth } from "@/lib/auth";
|
||||
|
||||
const PUBLIC_PATHS = ["/login", "/coming-soon"];
|
||||
|
||||
const WEBSITE_HOSTS = new Set([
|
||||
"mana-collection.com",
|
||||
"www.mana-collection.com",
|
||||
]);
|
||||
const PUBLIC_PATHS = ["/login"];
|
||||
|
||||
export default function RequireStoreAuth({
|
||||
children,
|
||||
@@ -20,14 +15,9 @@ export default function RequireStoreAuth({
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
|
||||
const host =
|
||||
typeof window !== "undefined"
|
||||
? window.location.hostname.toLowerCase()
|
||||
: "";
|
||||
const onWebsite = WEBSITE_HOSTS.has(host);
|
||||
const isPublic =
|
||||
onWebsite ||
|
||||
PUBLIC_PATHS.some((p) => pathname === p || pathname.startsWith(`${p}/`));
|
||||
const isPublic = PUBLIC_PATHS.some(
|
||||
(p) => pathname === p || pathname.startsWith(`${p}/`),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (loading || isPublic) return;
|
||||
|
||||
Reference in New Issue
Block a user