import { CardContent, CardHeader } from "@/components/ui/card"; import { TooltipProvider } from "@/components/ui/tooltip"; import { ResetPasswordForm } from "@/components/wrappers/auth/login/reset-password-form/reset-password-form"; import { redirect } from "next/navigation"; import { auth } from "@/lib/auth/auth"; import { Avatar, AvatarImage, AvatarFallback } from "@radix-ui/react-avatar"; import { CardAuth } from "@/features/layout/card-auth"; import { env } from "@/env.mjs"; export default async function RoutePage(props: { searchParams: Promise<{ token: string | undefined }> }) { if (env.AUTH_EMAIL_PASSWORD_ENABLED !== "true") { return redirect("/login"); } const { token } = await props.searchParams; if (!token) { return redirect(`/login?error=invalid_or_expired_token`); } const verification = await (await auth.$context).internalAdapter.findVerificationValue(`reset-password:${token}`); if (!verification || verification.expiresAt < new Date()) { return redirect(`/login?error=invalid_or_expired_token`); } const user = await (await auth.$context).internalAdapter.findUserById(verification.value); return (

Set a new password

Please enter your new password below.

{user!.name .split(" ") .map((n) => n[0]) .join("") .toUpperCase() .slice(0, 2)}
{user!.name}
{user!.email}
); }