mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 20:27:44 +00:00
18 lines
388 B
TypeScript
18 lines
388 B
TypeScript
import { auth } from "@/lib/auth";
|
|
import { headers } from "next/headers";
|
|
import { redirect } from "next/navigation";
|
|
|
|
export default async function DevicePage({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const session = await auth.api.getSession({
|
|
headers: await headers(),
|
|
});
|
|
if (session === null) {
|
|
throw redirect("/sign-in?callbackUrl=/device");
|
|
}
|
|
return children;
|
|
}
|