30 lines
824 B
TypeScript
30 lines
824 B
TypeScript
/**
|
|
* Forgot Password Page
|
|
*
|
|
* RSC composition pattern:
|
|
* 1. PageQuery executes to get ViewData
|
|
* 2. Client component renders with ViewData
|
|
*/
|
|
|
|
import { ForgotPasswordPageQuery } from '@/lib/page-queries/auth/ForgotPasswordPageQuery';
|
|
import { ForgotPasswordClient } from './ForgotPasswordClient';
|
|
import { AuthError } from '@/ui/AuthError';
|
|
|
|
export default async function ForgotPasswordPage({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<URLSearchParams>;
|
|
}) {
|
|
// Execute PageQuery
|
|
const params = await searchParams;
|
|
const queryResult = await ForgotPasswordPageQuery.execute(params);
|
|
|
|
if (queryResult.isErr()) {
|
|
return <AuthError action="forgot password" />;
|
|
}
|
|
|
|
const viewData = queryResult.unwrap();
|
|
|
|
// Render client component with ViewData
|
|
return <ForgotPasswordClient viewData={viewData} />;
|
|
} |