The code changes correspond to the rebranding of "Password Reset" to "Update Password". The names of components, functions, and routes have been updated to reflect this change. Also, a minor code optimization has been made in the i18n.server file for the creation of i18n server instances.
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import Link from 'next/link';
|
|
|
|
import { PasswordResetRequestContainer } from '@kit/auth/password-reset';
|
|
import { Button } from '@kit/ui/button';
|
|
import { Heading } from '@kit/ui/heading';
|
|
import { Trans } from '@kit/ui/trans';
|
|
|
|
import pathsConfig from '~/config/paths.config';
|
|
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
|
import { withI18n } from '~/lib/i18n/with-i18n';
|
|
|
|
export const generateMetadata = async () => {
|
|
const { t } = await createI18nServerInstance();
|
|
|
|
return {
|
|
title: t('auth:passwordResetLabel'),
|
|
};
|
|
};
|
|
|
|
const { callback, passwordUpdate, signIn } = pathsConfig.auth;
|
|
const redirectPath = `${callback}?next=${passwordUpdate}`;
|
|
|
|
function PasswordResetPage() {
|
|
return (
|
|
<>
|
|
<Heading level={4}>
|
|
<Trans i18nKey={'auth:passwordResetLabel'} />
|
|
</Heading>
|
|
|
|
<div className={'flex flex-col space-y-4'}>
|
|
<PasswordResetRequestContainer redirectPath={redirectPath} />
|
|
|
|
<div className={'flex justify-center text-xs'}>
|
|
<Link href={signIn}>
|
|
<Button variant={'link'} size={'sm'}>
|
|
<Trans i18nKey={'auth:passwordRecoveredQuestion'} />
|
|
</Button>
|
|
</Link>
|
|
</div>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default withI18n(PasswordResetPage);
|