import { auth } from "@/lib/auth";
import { headers } from "next/headers";
import { redirect } from "next/navigation";
export default async function DashboardPage() {
const [session, activeSessions] = await Promise.all([
auth.api.getSession({
headers: await headers(),
}),
auth.api.listSessions({
headers: await headers(),
}),
]).catch((e) => {
console.log(e);
throw redirect("/sign-in");
});
console.log(activeSessions, session);
return (
<div className="w-full">
<div className="flex gap-4 flex-col">
<h1 className="text-2xl font-bold">{session?.user}</h1>
</div>
</div>
);
}
import { auth } from "@/lib/auth";
import { headers } from "next/headers";
import { redirect } from "next/navigation";
export default async function DashboardPage() {
const [session, activeSessions] = await Promise.all([
auth.api.getSession({
headers: await headers(),
}),
auth.api.listSessions({
headers: await headers(),
}),
]).catch((e) => {
console.log(e);
throw redirect("/sign-in");
});
console.log(activeSessions, session);
return (
<div className="w-full">
<div className="flex gap-4 flex-col">
<h1 className="text-2xl font-bold">{session?.user}</h1>
</div>
</div>
);
}