Added serverside translations to the forgot password page. (#7618)
parent
58b439ca65
commit
5ebbd514d8
|
@ -2,6 +2,7 @@ import type { ResetPasswordRequest } from "@prisma/client";
|
||||||
import debounce from "lodash/debounce";
|
import debounce from "lodash/debounce";
|
||||||
import type { GetServerSidePropsContext } from "next";
|
import type { GetServerSidePropsContext } from "next";
|
||||||
import { getCsrfToken } from "next-auth/react";
|
import { getCsrfToken } from "next-auth/react";
|
||||||
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import React, { useMemo } from "react";
|
import React, { useMemo } from "react";
|
||||||
|
|
||||||
|
@ -185,6 +186,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||||
},
|
},
|
||||||
id,
|
id,
|
||||||
csrfToken: await getCsrfToken({ req: context.req }),
|
csrfToken: await getCsrfToken({ req: context.req }),
|
||||||
|
...(await serverSideTranslations(context.locale || "en", ["common"])),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
} catch (reason) {
|
} catch (reason) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import debounce from "lodash/debounce";
|
import debounce from "lodash/debounce";
|
||||||
import type { GetServerSidePropsContext } from "next";
|
import type { GetServerSidePropsContext } from "next";
|
||||||
import { getCsrfToken } from "next-auth/react";
|
import { getCsrfToken } from "next-auth/react";
|
||||||
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import type { SyntheticEvent } from "react";
|
import type { SyntheticEvent } from "react";
|
||||||
|
@ -144,5 +145,6 @@ ForgotPassword.getInitialProps = async (context: GetServerSidePropsContext) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
csrfToken: await getCsrfToken(context),
|
csrfToken: await getCsrfToken(context),
|
||||||
|
...(await serverSideTranslations(context.locale || "en", ["common"])),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue