Files
myeasycms-v2/apps/web/app/auth/password-reset/page.tsx
giancarlo 8a614bd6fc Refactor auth methods, remove i18n, and update UI
This commit covers a variety of actions that includes the refactoring of the authentication components to accept paths and invite tokens as props instead of a singular callback prop, thereby improving the component's flexibility. This refactor process removes 'withI18n' calls as i18n functionalities are no longer used. The commit also contains several adjustments to the UI components, including the authorization layout, pricing table, and sign-up page. It also includes minor changes to error messages, specifically those related to password resetting. Lastly, several peer dependencies are removed in the 'package.json' files and changes made to the 'browser.client.ts' file providing a significant code cleanup.
2024-03-27 01:19:20 +08:00

45 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 i18n = await createI18nServerInstance();
return {
title: i18n.t('auth:passwordResetLabel'),
};
};
function PasswordResetPage() {
const redirectPath = `${pathsConfig.auth.callback}?next=${pathsConfig.auth.passwordUpdate}`;
return (
<>
<Heading level={5}>
<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={pathsConfig.auth.signIn}>
<Button variant={'link'} size={'sm'}>
<Trans i18nKey={'auth:passwordRecoveredQuestion'} />
</Button>
</Link>
</div>
</div>
</>
);
}
export default withI18n(PasswordResetPage);