28 lines
589 B
TypeScript
28 lines
589 B
TypeScript
import { fetchUser } from "@/actions/auth";
|
|
import { redirect } from "next/navigation";
|
|
import MeComponent from "./component";
|
|
|
|
import { fetchConsents } from "@/actions/consents";
|
|
import { fetchOAuthClients } from "@/actions/clients";
|
|
|
|
export default async function Me() {
|
|
const user = await fetchUser();
|
|
|
|
if (!user) {
|
|
redirect("/api/auth/initiate");
|
|
}
|
|
|
|
const [consents, clients] = await Promise.all([
|
|
fetchConsents(),
|
|
fetchOAuthClients(),
|
|
]);
|
|
|
|
return (
|
|
<MeComponent
|
|
userData={user}
|
|
consentsData={consents}
|
|
clientsData={clients}
|
|
/>
|
|
);
|
|
}
|