47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
/**
|
|
* Auth Page - Server Component Wrapper for Next.js App Router
|
|
*
|
|
* Default auth UI: login, register, forgot, reset, confirm, logout at /auth/[...auth].
|
|
* Re-export in your app: export { default } from '@hykocx/zen/auth/page';
|
|
*
|
|
* For custom auth pages (all flows) that match your site style, use components from
|
|
* '@hykocx/zen/auth/components' and actions from '@hykocx/zen/auth/actions'.
|
|
* See README-custom-login.md in this package. Basic sites can keep using this default page.
|
|
*/
|
|
|
|
import { AuthPagesClient } from '@hykocx/zen/auth/pages';
|
|
import {
|
|
registerAction,
|
|
loginAction,
|
|
logoutAction,
|
|
forgotPasswordAction,
|
|
resetPasswordAction,
|
|
verifyEmailAction,
|
|
setSessionCookie,
|
|
getSession
|
|
} from '@hykocx/zen/auth/actions';
|
|
|
|
export default async function AuthPage({ params, searchParams }) {
|
|
const session = await getSession();
|
|
|
|
return (
|
|
<div className="min-h-screen flex items-center justify-center p-4 md:p-8">
|
|
<div className="max-w-md w-full">
|
|
<AuthPagesClient
|
|
params={params}
|
|
searchParams={searchParams}
|
|
registerAction={registerAction}
|
|
loginAction={loginAction}
|
|
logoutAction={logoutAction}
|
|
forgotPasswordAction={forgotPasswordAction}
|
|
resetPasswordAction={resetPasswordAction}
|
|
verifyEmailAction={verifyEmailAction}
|
|
setSessionCookieAction={setSessionCookie}
|
|
redirectAfterLogin={process.env.ZEN_AUTH_REDIRECT_AFTER_LOGIN || '/'}
|
|
currentUser={session?.user || null}
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|