Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435
  1. import { NextPage } from 'next';
  2. import { getSession } from 'next-auth/react';
  3. import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
  4. import { useRouter } from 'next/router';
  5. import { useEffect } from 'react';
  6. import ForgotPasswordForm from '../../../components/forms/forgot-password/ForgotPasswordForm';
  7. import { BASE_PAGE } from '../../../constants/pages';
  8. const ForgotPasswordPage: NextPage = () => {
  9. const router = useRouter();
  10. useEffect(() => {
  11. getSession().then((session) => {
  12. if (session) {
  13. router.replace(BASE_PAGE);
  14. }
  15. });
  16. }, [router]);
  17. return <ForgotPasswordForm />;
  18. };
  19. export async function getStaticProps({ locale }: any) {
  20. return {
  21. props: {
  22. ...(await serverSideTranslations(locale, [
  23. 'forms',
  24. 'forgotPass',
  25. 'common',
  26. ])),
  27. },
  28. };
  29. }
  30. export default ForgotPasswordPage;