7ef37e3ebd
- Prefix feature exports with `features/` (auth, admin, provider) - Prefix shared exports with `shared/` (components, icons, lib, config, logger, rate-limit) - Add new explicit exports for `shared/logger`, `shared/config`, and `shared/rate-limit` - Update internal imports to use package self-referencing (`@zen/core/shared/*`) instead of relative paths
44 lines
2.3 KiB
JavaScript
44 lines
2.3 KiB
JavaScript
/**
|
|
* Auth Components Export
|
|
*
|
|
* Use these components to build custom auth pages for every flow (login, register, forgot,
|
|
* reset, confirm, logout) so they match your site's style.
|
|
* For a ready-made catch-all auth UI, use AuthPagesClient from '@zen/core/features/auth/pages'.
|
|
* For the default full-page auth (no custom layout), re-export from '@zen/core/features/auth/page'.
|
|
*
|
|
* --- Custom auth pages (all types) ---
|
|
*
|
|
* Pattern: server component loads session/searchParams and passes actions to a client wrapper;
|
|
* client wrapper uses useRouter for onNavigate and renders the Zen component.
|
|
*
|
|
* Component props:
|
|
* - LoginPage: onSubmit (loginAction), onSetSessionCookie, onNavigate, redirectAfterLogin, currentUser
|
|
* - RegisterPage: onSubmit (registerAction), onNavigate, currentUser
|
|
* - ForgotPasswordPage: onSubmit (forgotPasswordAction), onNavigate, currentUser
|
|
* - ResetPasswordPage: onSubmit (resetPasswordAction), onNavigate, email, token (from URL)
|
|
* - ConfirmEmailPage: onSubmit (verifyEmailAction), onNavigate, email, token (from URL)
|
|
* - LogoutPage: onLogout (logoutAction), onSetSessionCookie (optional)
|
|
*
|
|
* onNavigate receives 'login' | 'register' | 'forgot' | 'reset'. Map to your routes (e.g. /auth/${page}).
|
|
* For reset/confirm, pass email and token from searchParams. Full guide: see README-custom-login.md in this package.
|
|
* Protect routes with protect() from '@zen/core/features/auth', redirectTo your login path.
|
|
*
|
|
* --- Dashboard / user display ---
|
|
*
|
|
* UserAvatar, UserMenu, AccountSection, useCurrentUser: see README-dashboard.md.
|
|
*/
|
|
|
|
export { default as AuthPagesLayout } from './AuthPagesLayout.js';
|
|
export { default as AuthPagesClient } from './AuthPages.js';
|
|
export { default as LoginPage } from './pages/LoginPage.js';
|
|
export { default as RegisterPage } from './pages/RegisterPage.js';
|
|
export { default as ForgotPasswordPage } from './pages/ForgotPasswordPage.js';
|
|
export { default as ResetPasswordPage } from './pages/ResetPasswordPage.js';
|
|
export { default as ConfirmEmailPage } from './pages/ConfirmEmailPage.js';
|
|
export { default as LogoutPage } from './pages/LogoutPage.js';
|
|
|
|
export { default as UserAvatar } from './UserAvatar.js';
|
|
export { default as UserMenu } from './UserMenu.js';
|
|
export { default as AccountSection } from './AccountSection.js';
|
|
export { useCurrentUser } from './useCurrentUser.js';
|