Files
myeasycms-v2/apps/web/app/update-password/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

29 lines
891 B
TypeScript

import { redirect } from 'next/navigation';
import { PasswordResetForm } from '@kit/auth/password-reset';
import { AuthLayoutShell } from '@kit/auth/shared';
import { requireAuth } from '@kit/supabase/require-auth';
import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client';
import { AppLogo } from '~/components/app-logo';
import pathsConfig from '~/config/paths.config';
import { withI18n } from '~/lib/i18n/with-i18n';
async function PasswordResetPage() {
const client = getSupabaseServerComponentClient();
const auth = await requireAuth(client);
// we require the user to be logged in to access this page
if (auth.error) {
redirect(auth.redirectTo);
}
return (
<AuthLayoutShell Logo={AppLogo}>
<PasswordResetForm redirectTo={pathsConfig.app.home} />
</AuthLayoutShell>
);
}
export default withI18n(PasswordResetPage);