refactor: reorganize imports and improve session handling in various components 🔨
Some checks are pending
Build and Push Docker Images / Build and Push Docker Images (push) Has started running

This commit is contained in:
2025-07-01 07:53:21 +05:00
parent 1549b209b3
commit a6d844e8d1
11 changed files with 121 additions and 143 deletions

View File

@ -1,4 +1,7 @@
import { redirect } from "next/navigation";
import { getServerSession } from "next-auth";
import { Suspense } from "react";
import { authOptions } from "@/app/auth";
import { AdminDevicesTable } from "@/components/admin/admin-devices-table";
import DynamicFilter from "@/components/generic-filter";
@ -13,6 +16,8 @@ export default async function UserDevices({
}>;
}) {
const query = (await searchParams)?.query || "";
const session = await getServerSession(authOptions);
if (session?.user?.is_admin !== true) redirect("/devices?page=1");
return (
<div>
<div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">