mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* remove packages/lib/server/stripe * simplify metadata * define business logic directly in trpc handler
31 lines
798 B
TypeScript
31 lines
798 B
TypeScript
import type { PageProps as _PageProps } from "app/_types";
|
|
import { _generateMetadata } from "app/_utils";
|
|
import { z } from "zod";
|
|
|
|
import VerifyPage from "~/auth/verify-view";
|
|
|
|
const querySchema = z.object({
|
|
stripeCustomerId: z.string().optional(),
|
|
sessionId: z.string().optional(),
|
|
t: z.string().optional(),
|
|
});
|
|
|
|
export const generateMetadata = async ({ params, searchParams }: _PageProps) => {
|
|
const p = { ...(await params), ...(await searchParams) };
|
|
const { sessionId } = querySchema.parse(p);
|
|
|
|
return await _generateMetadata(
|
|
() => (sessionId ? "Payment Page" : `Verify your email`),
|
|
() => "",
|
|
undefined,
|
|
undefined,
|
|
"/auth/verify"
|
|
);
|
|
};
|
|
|
|
const ServerPage = () => {
|
|
return <VerifyPage EMAIL_FROM={process.env.EMAIL_FROM} />;
|
|
};
|
|
|
|
export default ServerPage;
|