B2B-88: add starter kit structure and elements
This commit is contained in:
39
app/update-password/page.tsx
Normal file
39
app/update-password/page.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import { UpdatePasswordForm } from '@kit/auth/password-reset';
|
||||
import { AuthLayoutShell } from '@kit/auth/shared';
|
||||
|
||||
import { AppLogo } from '~/components/app-logo';
|
||||
import pathsConfig from '~/config/paths.config';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
import { requireUserInServerComponent } from '~/lib/server/require-user-in-server-component';
|
||||
|
||||
export const generateMetadata = async () => {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return {
|
||||
title: t('auth:updatePassword'),
|
||||
};
|
||||
};
|
||||
|
||||
const Logo = () => <AppLogo href={''} />;
|
||||
|
||||
interface UpdatePasswordPageProps {
|
||||
searchParams: Promise<{
|
||||
callback?: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
async function UpdatePasswordPage(props: UpdatePasswordPageProps) {
|
||||
await requireUserInServerComponent();
|
||||
|
||||
const { callback } = await props.searchParams;
|
||||
const redirectTo = callback ?? pathsConfig.app.home;
|
||||
|
||||
return (
|
||||
<AuthLayoutShell Logo={Logo}>
|
||||
<UpdatePasswordForm redirectTo={redirectTo} />
|
||||
</AuthLayoutShell>
|
||||
);
|
||||
}
|
||||
|
||||
export default withI18n(UpdatePasswordPage);
|
||||
Reference in New Issue
Block a user