import { redirect } from "next/navigation"; import { getClientByClientId } from "@/lib/dto/client"; import { getCurrentUser } from "@/lib/session"; import { Authorizing } from "@/components/auth/authorizing"; import { ErrorCard } from "@/components/auth/error-card"; export interface AuthorizeParams { oauth: string; clientId: string; scope: string; redirectUri: string; } export default async function AuthorizePage({ searchParams, }: { searchParams: AuthorizeParams; }) { const user = await getCurrentUser(); if (!user?.id) { redirect("/login"); } const client = await getClientByClientId(searchParams.clientId); if (!client) { return (