import { auth, signIn, signOut } from "@/auth";
import { ShellEmpty } from "@/components/ShellEmpty";
import type { SessionWithExtras } from "@/lib/session";
import { fetchTenantBySlug } from "@/lib/tenant-registry";
export default async function Dashboard({
params,
}: {
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
const session = (await auth()) as SessionWithExtras | null;
if (!session) {
async function login() {
"use server";
await signIn("keycloak", { redirectTo: `/${slug}/dashboard` });
}
return (
Welcome, {session.user?.name ?? session.user?.email ?? "user"}. Signed in
as
Tile content lands in Sign in to {slug}
Dashboard
{session.org_roles?.join(", ") ?? "(no roles)"}.
Your products
{products.length === 0 ? (
{products.map((p) => (
)}
M10.1.