mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* wip * wip * refactor * add pathname * fix * fix: manually construct pathname for metadata functions Co-Authored-By: [email protected] <[email protected]> * fix: add pathname parameter to all metadata functions Co-Authored-By: [email protected] <[email protected]> * fix: add pathname parameter to remaining metadata functions Co-Authored-By: [email protected] <[email protected]> * fix * fix * fix type checks * Refactor * fix * fix --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import type { PageProps as ServerPageProps } from "app/_types";
|
|
import { _generateMetadata } from "app/_utils";
|
|
import { getCsrfToken } from "next-auth/react";
|
|
import { cookies, headers } from "next/headers";
|
|
import { redirect } from "next/navigation";
|
|
|
|
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
|
|
|
|
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
|
|
|
import ForgotPassword from "~/auth/forgot-password/forgot-password-view";
|
|
|
|
export const generateMetadata = async () => {
|
|
return await _generateMetadata(
|
|
(t) => t("forgot_password"),
|
|
(t) => t("request_password_reset"),
|
|
undefined,
|
|
undefined,
|
|
"/auth/forgot-password"
|
|
);
|
|
};
|
|
|
|
const ServerPage = async ({ params, searchParams }: ServerPageProps) => {
|
|
const context = buildLegacyCtx(await headers(), await cookies(), await params, await searchParams);
|
|
const session = await getServerSession({ req: context.req });
|
|
|
|
if (session) {
|
|
redirect("/");
|
|
}
|
|
|
|
const csrfToken = await getCsrfToken(context);
|
|
|
|
return <ForgotPassword csrfToken={csrfToken} />;
|
|
};
|
|
|
|
export default ServerPage;
|