page.tsx26 lines · main
1import { NewPasswordForm } from './new-password-form';
2
3export const dynamic = 'force-dynamic';
4export const metadata = { title: 'auth · set new password' };
5
6/**
7 * Hosted new-password page. Better Auth builds the reset email URL as:
8 * `${redirectTo}?token=<token>`
9 * where `redirectTo` is the value the reset-password form passes
10 * (`/auth/<projectId>/new-password`). This page reads `?token=` and
11 * hands it to the client-side form.
12 *
13 * POST target: POST /api/v1/auth-tenant/reset-password
14 * { token: string; newPassword: string }
15 */
16export default async function NewPasswordPage({
17 params,
18 searchParams,
19}: {
20 params: Promise<{ projectId: string }>;
21 searchParams: Promise<{ token?: string }>;
22}) {
23 const { projectId } = await params;
24 const { token = '' } = await searchParams;
25 return <NewPasswordForm projectId={projectId} token={token} />;
26}