refactor: implement session checking utility, enhance device queries with session validation, and improve UI interactions for device management

This commit is contained in:
2025-04-06 22:43:12 +05:00
parent 9e2a2f430e
commit daab793592
7 changed files with 256 additions and 192 deletions
+11
View File
@@ -0,0 +1,11 @@
"use server";
import { authOptions } from "@/app/auth";
import { getServerSession } from "next-auth";
import { redirect } from "next/navigation";
export async function checkSession() {
const session = await getServerSession(authOptions);
if (!session) return redirect("/auth/signin");
return session;
}