fix auth
This commit is contained in:
@@ -1,8 +1,25 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Dashboard from "@/components/kokonutui/dashboard";
|
||||
import { Package } from "lucide-react";
|
||||
import OrderTable from "@/components/order-table"
|
||||
import OrderTable from "@/components/order-table";
|
||||
|
||||
export default function OrdersPage() {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
const authToken = document.cookie
|
||||
.split("; ")
|
||||
.find((row) => row.startsWith("Authorization="))
|
||||
?.split("=")[1];
|
||||
|
||||
if (!authToken) {
|
||||
router.push("/login");
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<Dashboard>
|
||||
<div className="space-y-6">
|
||||
@@ -13,9 +30,8 @@ export default function OrdersPage() {
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
{/* ✅ Order Table Component */}
|
||||
<OrderTable />
|
||||
</div>
|
||||
</Dashboard>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user