hazo_auth 1.6.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +212 -12
- package/SETUP_CHECKLIST.md +81 -1
- package/dist/app/api/hazo_auth/login/route.d.ts.map +1 -1
- package/dist/app/api/hazo_auth/login/route.js +25 -0
- package/dist/app/api/hazo_auth/logout/route.d.ts.map +1 -1
- package/dist/app/api/hazo_auth/logout/route.js +5 -0
- package/dist/components/layouts/email_verification/hooks/use_email_verification.d.ts.map +1 -1
- package/dist/components/layouts/email_verification/hooks/use_email_verification.js +5 -3
- package/dist/components/layouts/email_verification/index.d.ts +2 -1
- package/dist/components/layouts/email_verification/index.d.ts.map +1 -1
- package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.d.ts.map +1 -1
- package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.js +3 -1
- package/dist/components/layouts/forgot_password/index.d.ts +2 -1
- package/dist/components/layouts/forgot_password/index.d.ts.map +1 -1
- package/dist/components/layouts/login/hooks/use_login_form.d.ts.map +1 -1
- package/dist/components/layouts/login/hooks/use_login_form.js +3 -1
- package/dist/components/layouts/login/index.d.ts +2 -1
- package/dist/components/layouts/login/index.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/components/profile_picture_dialog.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/components/profile_picture_dialog.js +3 -1
- package/dist/components/layouts/my_settings/components/profile_picture_library_tab.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/components/profile_picture_library_tab.js +4 -2
- package/dist/components/layouts/my_settings/hooks/use_my_settings.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/hooks/use_my_settings.js +7 -5
- package/dist/components/layouts/my_settings/index.d.ts +2 -1
- package/dist/components/layouts/my_settings/index.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/index.js +3 -2
- package/dist/components/layouts/register/hooks/use_register_form.d.ts.map +1 -1
- package/dist/components/layouts/register/hooks/use_register_form.js +37 -7
- package/dist/components/layouts/register/index.d.ts +2 -1
- package/dist/components/layouts/register/index.d.ts.map +1 -1
- package/dist/components/layouts/reset_password/hooks/use_reset_password_form.d.ts.map +1 -1
- package/dist/components/layouts/reset_password/hooks/use_reset_password_form.js +4 -2
- package/dist/components/layouts/reset_password/index.d.ts +2 -1
- package/dist/components/layouts/reset_password/index.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts +2 -1
- package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/logout_button.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/logout_button.js +3 -1
- package/dist/components/layouts/shared/components/profile_pic_menu.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/profile_pic_menu.js +8 -4
- package/dist/components/layouts/shared/components/two_column_auth_layout.d.ts +2 -1
- package/dist/components/layouts/shared/components/two_column_auth_layout.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/visual_panel.d.ts +2 -1
- package/dist/components/layouts/shared/components/visual_panel.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/visual_panel.js +2 -1
- package/dist/components/layouts/shared/hooks/use_auth_status.d.ts.map +1 -1
- package/dist/components/layouts/shared/hooks/use_auth_status.js +4 -2
- package/dist/components/layouts/shared/hooks/use_hazo_auth.d.ts.map +1 -1
- package/dist/components/layouts/shared/hooks/use_hazo_auth.js +4 -2
- package/dist/components/layouts/shared/index.d.ts +0 -2
- package/dist/components/layouts/shared/index.d.ts.map +1 -1
- package/dist/components/layouts/shared/index.js +2 -2
- package/dist/components/layouts/user_management/components/roles_matrix.d.ts.map +1 -1
- package/dist/components/layouts/user_management/components/roles_matrix.js +8 -6
- package/dist/components/layouts/user_management/index.d.ts.map +1 -1
- package/dist/components/layouts/user_management/index.js +15 -13
- package/dist/contexts/hazo_auth_config.d.ts +18 -0
- package/dist/contexts/hazo_auth_config.d.ts.map +1 -0
- package/dist/contexts/hazo_auth_config.js +10 -0
- package/dist/contexts/hazo_auth_provider.d.ts +73 -0
- package/dist/contexts/hazo_auth_provider.d.ts.map +1 -0
- package/dist/contexts/hazo_auth_provider.js +82 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/lib/auth/hazo_get_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.js +31 -3
- package/dist/lib/auth/session_token_validator.edge.d.ts +15 -0
- package/dist/lib/auth/session_token_validator.edge.d.ts.map +1 -0
- package/dist/lib/auth/session_token_validator.edge.js +64 -0
- package/dist/lib/config/default_config.d.ts +237 -0
- package/dist/lib/config/default_config.d.ts.map +1 -0
- package/dist/lib/config/default_config.js +159 -0
- package/dist/lib/email_verification_config.server.d.ts +4 -0
- package/dist/lib/email_verification_config.server.d.ts.map +1 -1
- package/dist/lib/email_verification_config.server.js +12 -0
- package/dist/lib/forgot_password_config.server.d.ts +4 -0
- package/dist/lib/forgot_password_config.server.d.ts.map +1 -1
- package/dist/lib/forgot_password_config.server.js +12 -0
- package/dist/lib/login_config.server.d.ts +4 -0
- package/dist/lib/login_config.server.d.ts.map +1 -1
- package/dist/lib/login_config.server.js +10 -0
- package/dist/lib/password_requirements_config.server.d.ts +1 -1
- package/dist/lib/password_requirements_config.server.d.ts.map +1 -1
- package/dist/lib/password_requirements_config.server.js +8 -7
- package/dist/lib/register_config.server.d.ts +4 -0
- package/dist/lib/register_config.server.d.ts.map +1 -1
- package/dist/lib/register_config.server.js +10 -0
- package/dist/lib/reset_password_config.server.d.ts +4 -0
- package/dist/lib/reset_password_config.server.d.ts.map +1 -1
- package/dist/lib/reset_password_config.server.js +10 -0
- package/dist/lib/services/session_token_service.d.ts +27 -0
- package/dist/lib/services/session_token_service.d.ts.map +1 -0
- package/dist/lib/services/session_token_service.js +130 -0
- package/dist/page_components/forgot_password.d.ts.map +1 -1
- package/dist/page_components/forgot_password.js +14 -0
- package/dist/page_components/login.d.ts +4 -0
- package/dist/page_components/login.d.ts.map +1 -1
- package/dist/page_components/login.js +14 -0
- package/dist/page_components/register.d.ts.map +1 -1
- package/dist/page_components/register.js +14 -0
- package/dist/page_components/reset_password.d.ts.map +1 -1
- package/dist/page_components/reset_password.js +14 -0
- package/dist/page_components/verify_email.d.ts.map +1 -1
- package/dist/page_components/verify_email.js +14 -0
- package/dist/pages/forgot_password.d.ts +52 -0
- package/dist/pages/forgot_password.d.ts.map +1 -0
- package/dist/pages/forgot_password.js +41 -0
- package/dist/pages/index.d.ts +33 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/pages/index.js +28 -0
- package/dist/pages/login.d.ts +43 -0
- package/dist/pages/login.d.ts.map +1 -0
- package/dist/pages/login.js +45 -0
- package/dist/pages/my_settings.d.ts +54 -0
- package/dist/pages/my_settings.d.ts.map +1 -0
- package/dist/pages/my_settings.js +57 -0
- package/dist/pages/register.d.ts +44 -0
- package/dist/pages/register.d.ts.map +1 -0
- package/dist/pages/register.js +46 -0
- package/dist/pages/reset_password.d.ts +43 -0
- package/dist/pages/reset_password.d.ts.map +1 -0
- package/dist/pages/reset_password.js +42 -0
- package/dist/pages/verify_email.d.ts +52 -0
- package/dist/pages/verify_email.d.ts.map +1 -0
- package/dist/pages/verify_email.js +41 -0
- package/dist/server/middleware.d.ts +3 -0
- package/dist/server/middleware.d.ts.map +1 -0
- package/dist/server/middleware.js +5 -0
- package/dist/server_pages/forgot_password.d.ts +53 -0
- package/dist/server_pages/forgot_password.d.ts.map +1 -0
- package/dist/server_pages/forgot_password.js +40 -0
- package/dist/server_pages/forgot_password_client_wrapper.d.ts +15 -0
- package/dist/server_pages/forgot_password_client_wrapper.d.ts.map +1 -0
- package/dist/server_pages/forgot_password_client_wrapper.js +27 -0
- package/dist/server_pages/index.d.ts +13 -0
- package/dist/server_pages/index.d.ts.map +1 -0
- package/dist/server_pages/index.js +7 -0
- package/dist/server_pages/login.d.ts +43 -0
- package/dist/server_pages/login.d.ts.map +1 -0
- package/dist/server_pages/login.js +39 -0
- package/dist/server_pages/login_client_wrapper.d.ts +13 -0
- package/dist/server_pages/login_client_wrapper.d.ts.map +1 -0
- package/dist/server_pages/login_client_wrapper.js +29 -0
- package/dist/server_pages/my_settings.d.ts +53 -0
- package/dist/server_pages/my_settings.d.ts.map +1 -0
- package/dist/server_pages/my_settings.js +57 -0
- package/dist/server_pages/register.d.ts +45 -0
- package/dist/server_pages/register.d.ts.map +1 -0
- package/dist/server_pages/register.js +41 -0
- package/dist/server_pages/register_client_wrapper.d.ts +13 -0
- package/dist/server_pages/register_client_wrapper.d.ts.map +1 -0
- package/dist/server_pages/register_client_wrapper.js +27 -0
- package/dist/server_pages/reset_password.d.ts +44 -0
- package/dist/server_pages/reset_password.d.ts.map +1 -0
- package/dist/server_pages/reset_password.js +40 -0
- package/dist/server_pages/reset_password_client_wrapper.d.ts +13 -0
- package/dist/server_pages/reset_password_client_wrapper.d.ts.map +1 -0
- package/dist/server_pages/reset_password_client_wrapper.js +27 -0
- package/dist/server_pages/verify_email.d.ts +53 -0
- package/dist/server_pages/verify_email.d.ts.map +1 -0
- package/dist/server_pages/verify_email.js +40 -0
- package/dist/server_pages/verify_email_client_wrapper.d.ts +15 -0
- package/dist/server_pages/verify_email_client_wrapper.d.ts.map +1 -0
- package/dist/server_pages/verify_email_client_wrapper.js +27 -0
- package/package.json +39 -10
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// file_description: Client wrapper for ForgotPasswordLayout - handles data client initialization on client side
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
// section: imports
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import ForgotPasswordLayout from "../components/layouts/forgot_password";
|
|
7
|
+
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client";
|
|
8
|
+
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup";
|
|
9
|
+
// section: component
|
|
10
|
+
/**
|
|
11
|
+
* Client wrapper for ForgotPasswordLayout
|
|
12
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
|
+
*/
|
|
14
|
+
export function ForgotPasswordClientWrapper({ image_src, image_alt, image_background_color, sign_in_path, sign_in_label, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, }) {
|
|
15
|
+
const [dataClient, setDataClient] = useState(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
// Initialize hazo_connect on client side
|
|
18
|
+
const hazoConnect = create_sqlite_hazo_connect();
|
|
19
|
+
const client = createLayoutDataClient(hazoConnect);
|
|
20
|
+
setDataClient(client);
|
|
21
|
+
}, []);
|
|
22
|
+
// Show loading state while initializing
|
|
23
|
+
if (!dataClient) {
|
|
24
|
+
return (_jsx("div", { className: "cls_forgot_password_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
25
|
+
}
|
|
26
|
+
return (_jsx(ForgotPasswordLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, sign_in_path: sign_in_path, sign_in_label: sign_in_label, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { default as LoginPage } from "./login";
|
|
2
|
+
export { default as RegisterPage } from "./register";
|
|
3
|
+
export { default as ForgotPasswordPage } from "./forgot_password";
|
|
4
|
+
export { default as ResetPasswordPage } from "./reset_password";
|
|
5
|
+
export { default as VerifyEmailPage } from "./verify_email";
|
|
6
|
+
export { default as MySettingsPage } from "./my_settings";
|
|
7
|
+
export type { LoginPageProps } from "./login";
|
|
8
|
+
export type { RegisterPageProps } from "./register";
|
|
9
|
+
export type { ForgotPasswordPageProps } from "./forgot_password";
|
|
10
|
+
export type { ResetPasswordPageProps } from "./reset_password";
|
|
11
|
+
export type { VerifyEmailPageProps } from "./verify_email";
|
|
12
|
+
export type { MySettingsPageProps } from "./my_settings";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server_pages/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAG1D,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,YAAY,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,YAAY,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// file_description: Barrel export for all zero-config page components
|
|
2
|
+
export { default as LoginPage } from "./login";
|
|
3
|
+
export { default as RegisterPage } from "./register";
|
|
4
|
+
export { default as ForgotPasswordPage } from "./forgot_password";
|
|
5
|
+
export { default as ResetPasswordPage } from "./reset_password";
|
|
6
|
+
export { default as VerifyEmailPage } from "./verify_email";
|
|
7
|
+
export { default as MySettingsPage } from "./my_settings";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { StaticImageData } from "next/image";
|
|
2
|
+
export type LoginPageProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Optional image source for the visual panel
|
|
5
|
+
* Defaults from hazo_auth_config.ini or package default image
|
|
6
|
+
*/
|
|
7
|
+
image_src?: string | StaticImageData;
|
|
8
|
+
/**
|
|
9
|
+
* Optional image alt text
|
|
10
|
+
* Defaults to "Secure login illustration"
|
|
11
|
+
*/
|
|
12
|
+
image_alt?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional image background color
|
|
15
|
+
* Defaults to "#f1f5f9"
|
|
16
|
+
*/
|
|
17
|
+
image_background_color?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Zero-config LoginPage server component
|
|
21
|
+
*
|
|
22
|
+
* This component initializes everything server-side:
|
|
23
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
24
|
+
*
|
|
25
|
+
* The data client and logger are initialized on the client side to avoid serialization issues.
|
|
26
|
+
*
|
|
27
|
+
* Usage in consuming apps:
|
|
28
|
+
* ```tsx
|
|
29
|
+
* // app/login/page.tsx
|
|
30
|
+
* import { LoginPage } from "hazo_auth/pages/login";
|
|
31
|
+
*
|
|
32
|
+
* export default function Page() {
|
|
33
|
+
* return <LoginPage />;
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Zero configuration required - works out of the box!
|
|
38
|
+
*
|
|
39
|
+
* @param props - Optional visual customization props
|
|
40
|
+
* @returns Server-rendered login page
|
|
41
|
+
*/
|
|
42
|
+
export default function LoginPage({ image_src, image_alt, image_background_color, }?: LoginPageProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/server_pages/login.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,SAAS,EACT,sBAAsB,GACvB,GAAE,cAAmB,2CA4BrB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// file_description: Zero-config LoginPage server component - drop in and use with no configuration required
|
|
3
|
+
// section: imports
|
|
4
|
+
import { get_login_config } from "../lib/login_config.server";
|
|
5
|
+
import { LoginClientWrapper } from "./login_client_wrapper";
|
|
6
|
+
// section: component
|
|
7
|
+
/**
|
|
8
|
+
* Zero-config LoginPage server component
|
|
9
|
+
*
|
|
10
|
+
* This component initializes everything server-side:
|
|
11
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
12
|
+
*
|
|
13
|
+
* The data client and logger are initialized on the client side to avoid serialization issues.
|
|
14
|
+
*
|
|
15
|
+
* Usage in consuming apps:
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // app/login/page.tsx
|
|
18
|
+
* import { LoginPage } from "hazo_auth/pages/login";
|
|
19
|
+
*
|
|
20
|
+
* export default function Page() {
|
|
21
|
+
* return <LoginPage />;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* Zero configuration required - works out of the box!
|
|
26
|
+
*
|
|
27
|
+
* @param props - Optional visual customization props
|
|
28
|
+
* @returns Server-rendered login page
|
|
29
|
+
*/
|
|
30
|
+
export default function LoginPage({ image_src, image_alt, image_background_color, } = {}) {
|
|
31
|
+
// Load configuration from INI file (with defaults including asset images)
|
|
32
|
+
const config = get_login_config();
|
|
33
|
+
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
34
|
+
const finalImageSrc = image_src || config.imageSrc;
|
|
35
|
+
const finalImageAlt = image_alt || config.imageAlt;
|
|
36
|
+
const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
|
|
37
|
+
// Pass serializable config to client wrapper
|
|
38
|
+
return (_jsx(LoginClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, redirectRoute: config.redirectRoute, successMessage: config.successMessage, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath, forgotPasswordPath: config.forgotPasswordPath, forgotPasswordLabel: config.forgotPasswordLabel, createAccountPath: config.createAccountPath, createAccountLabel: config.createAccountLabel }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LoginConfig } from "../lib/login_config.server";
|
|
2
|
+
import type { StaticImageData } from "next/image";
|
|
3
|
+
export type LoginClientWrapperProps = Omit<LoginConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor'> & {
|
|
4
|
+
image_src: string | StaticImageData;
|
|
5
|
+
image_alt: string;
|
|
6
|
+
image_background_color: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Client wrapper for LoginLayout
|
|
10
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
11
|
+
*/
|
|
12
|
+
export declare function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, }: LoginClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=login_client_wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/login_client_wrapper.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,CAAC,GAAG;IAC1G,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAGF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,EAAE,uBAAuB,2CA0CzB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// file_description: Client wrapper for LoginLayout - handles data client initialization on client side
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
// section: imports
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import LoginLayout from "../components/layouts/login";
|
|
7
|
+
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client";
|
|
8
|
+
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup";
|
|
9
|
+
import { create_app_logger } from "../lib/app_logger";
|
|
10
|
+
// section: component
|
|
11
|
+
/**
|
|
12
|
+
* Client wrapper for LoginLayout
|
|
13
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
14
|
+
*/
|
|
15
|
+
export function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, }) {
|
|
16
|
+
const [dataClient, setDataClient] = useState(null);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
// Initialize hazo_connect on client side
|
|
19
|
+
const hazoConnect = create_sqlite_hazo_connect();
|
|
20
|
+
const client = createLayoutDataClient(hazoConnect);
|
|
21
|
+
setDataClient(client);
|
|
22
|
+
}, []);
|
|
23
|
+
// Show loading state while initializing
|
|
24
|
+
if (!dataClient) {
|
|
25
|
+
return (_jsx("div", { className: "cls_login_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
26
|
+
}
|
|
27
|
+
const logger = create_app_logger();
|
|
28
|
+
return (_jsx(LoginLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, logger: logger, redirectRoute: redirectRoute, successMessage: successMessage, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, forgot_password_path: forgotPasswordPath, forgot_password_label: forgotPasswordLabel, create_account_path: createAccountPath, create_account_label: createAccountLabel }));
|
|
29
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type MySettingsPageProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Optional className for custom styling
|
|
4
|
+
*/
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Zero-config MySettingsPage server component
|
|
9
|
+
*
|
|
10
|
+
* This component initializes everything server-side:
|
|
11
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
12
|
+
* - User field visibility settings
|
|
13
|
+
* - Password requirements
|
|
14
|
+
* - Profile picture configuration
|
|
15
|
+
* - UI messages and labels
|
|
16
|
+
*
|
|
17
|
+
* Usage in consuming apps:
|
|
18
|
+
*
|
|
19
|
+
* **As a full page:**
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // app/settings/page.tsx
|
|
22
|
+
* import { MySettingsPage } from "hazo_auth/pages/my_settings";
|
|
23
|
+
*
|
|
24
|
+
* export default function Page() {
|
|
25
|
+
* return <MySettingsPage />;
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* **Embedded in a dashboard:**
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // app/dashboard/page.tsx
|
|
32
|
+
* import { MySettingsPage } from "hazo_auth/pages/my_settings";
|
|
33
|
+
*
|
|
34
|
+
* export default function Page() {
|
|
35
|
+
* return (
|
|
36
|
+
* <div className="dashboard-container">
|
|
37
|
+
* <Sidebar />
|
|
38
|
+
* <main>
|
|
39
|
+
* <MySettingsPage className="max-w-4xl mx-auto" />
|
|
40
|
+
* </main>
|
|
41
|
+
* </div>
|
|
42
|
+
* );
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* Zero configuration required - works out of the box!
|
|
47
|
+
* The component is fully embeddable and adapts to its container.
|
|
48
|
+
*
|
|
49
|
+
* @param props - Optional className for custom styling
|
|
50
|
+
* @returns Server-rendered my settings component
|
|
51
|
+
*/
|
|
52
|
+
export default function MySettingsPage({ className, }?: MySettingsPageProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
//# sourceMappingURL=my_settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my_settings.d.ts","sourceRoot":"","sources":["../../src/server_pages/my_settings.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,GACV,GAAE,mBAAwB,2CA8B1B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// file_description: Zero-config MySettingsPage server component - drop in and use with no configuration required
|
|
3
|
+
// section: imports
|
|
4
|
+
import { get_my_settings_config } from "../lib/my_settings_config.server";
|
|
5
|
+
import MySettingsLayout from "../components/layouts/my_settings";
|
|
6
|
+
// section: component
|
|
7
|
+
/**
|
|
8
|
+
* Zero-config MySettingsPage server component
|
|
9
|
+
*
|
|
10
|
+
* This component initializes everything server-side:
|
|
11
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
12
|
+
* - User field visibility settings
|
|
13
|
+
* - Password requirements
|
|
14
|
+
* - Profile picture configuration
|
|
15
|
+
* - UI messages and labels
|
|
16
|
+
*
|
|
17
|
+
* Usage in consuming apps:
|
|
18
|
+
*
|
|
19
|
+
* **As a full page:**
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // app/settings/page.tsx
|
|
22
|
+
* import { MySettingsPage } from "hazo_auth/pages/my_settings";
|
|
23
|
+
*
|
|
24
|
+
* export default function Page() {
|
|
25
|
+
* return <MySettingsPage />;
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* **Embedded in a dashboard:**
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // app/dashboard/page.tsx
|
|
32
|
+
* import { MySettingsPage } from "hazo_auth/pages/my_settings";
|
|
33
|
+
*
|
|
34
|
+
* export default function Page() {
|
|
35
|
+
* return (
|
|
36
|
+
* <div className="dashboard-container">
|
|
37
|
+
* <Sidebar />
|
|
38
|
+
* <main>
|
|
39
|
+
* <MySettingsPage className="max-w-4xl mx-auto" />
|
|
40
|
+
* </main>
|
|
41
|
+
* </div>
|
|
42
|
+
* );
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* Zero configuration required - works out of the box!
|
|
47
|
+
* The component is fully embeddable and adapts to its container.
|
|
48
|
+
*
|
|
49
|
+
* @param props - Optional className for custom styling
|
|
50
|
+
* @returns Server-rendered my settings component
|
|
51
|
+
*/
|
|
52
|
+
export default function MySettingsPage({ className, } = {}) {
|
|
53
|
+
// Load configuration from INI file (with defaults)
|
|
54
|
+
const config = get_my_settings_config();
|
|
55
|
+
// Render layout with all server-initialized configuration
|
|
56
|
+
return (_jsx(MySettingsLayout, { className: className, password_requirements: config.passwordRequirements, profilePicture: config.profilePicture, userFields: config.userFields, unauthorizedMessage: config.unauthorizedMessage, loginButtonLabel: config.loginButtonLabel, loginPath: config.loginPath, heading: config.heading, subHeading: config.subHeading, profilePhotoLabel: config.profilePhotoLabel, profilePhotoRecommendation: config.profilePhotoRecommendation, uploadPhotoButtonLabel: config.uploadPhotoButtonLabel, removePhotoButtonLabel: config.removePhotoButtonLabel, profileInformationLabel: config.profileInformationLabel, passwordLabel: config.passwordLabel, currentPasswordLabel: config.currentPasswordLabel, newPasswordLabel: config.newPasswordLabel, confirmPasswordLabel: config.confirmPasswordLabel, messages: config.messages, uiSizes: config.uiSizes, fileTypes: config.fileTypes }));
|
|
57
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { StaticImageData } from "next/image";
|
|
2
|
+
export type RegisterPageProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Optional image source for the visual panel
|
|
5
|
+
* Defaults from hazo_auth_config.ini or package default image
|
|
6
|
+
*/
|
|
7
|
+
image_src?: string | StaticImageData;
|
|
8
|
+
/**
|
|
9
|
+
* Optional image alt text
|
|
10
|
+
* Defaults from hazo_auth_config.ini or "Modern building representing user registration"
|
|
11
|
+
*/
|
|
12
|
+
image_alt?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional image background color
|
|
15
|
+
* Defaults from hazo_auth_config.ini or "#e2e8f0"
|
|
16
|
+
*/
|
|
17
|
+
image_background_color?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Zero-config RegisterPage server component
|
|
21
|
+
*
|
|
22
|
+
* This component initializes everything server-side:
|
|
23
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
24
|
+
* - Password requirements
|
|
25
|
+
* - User field visibility
|
|
26
|
+
*
|
|
27
|
+
* The data client is initialized on the client side to avoid serialization issues.
|
|
28
|
+
*
|
|
29
|
+
* Usage in consuming apps:
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // app/register/page.tsx
|
|
32
|
+
* import { RegisterPage } from "hazo_auth/pages/register";
|
|
33
|
+
*
|
|
34
|
+
* export default function Page() {
|
|
35
|
+
* return <RegisterPage />;
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* Zero configuration required - works out of the box!
|
|
40
|
+
*
|
|
41
|
+
* @param props - Optional visual customization props
|
|
42
|
+
* @returns Server-rendered register page
|
|
43
|
+
*/
|
|
44
|
+
export default function RegisterPage({ image_src, image_alt, image_background_color, }?: RegisterPageProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/server_pages/register.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAS,EACT,SAAS,EACT,sBAAsB,GACvB,GAAE,iBAAsB,2CA0BxB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// file_description: Zero-config RegisterPage server component - drop in and use with no configuration required
|
|
3
|
+
// section: imports
|
|
4
|
+
import { get_register_config } from "../lib/register_config.server";
|
|
5
|
+
import { RegisterClientWrapper } from "./register_client_wrapper";
|
|
6
|
+
// section: component
|
|
7
|
+
/**
|
|
8
|
+
* Zero-config RegisterPage server component
|
|
9
|
+
*
|
|
10
|
+
* This component initializes everything server-side:
|
|
11
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
12
|
+
* - Password requirements
|
|
13
|
+
* - User field visibility
|
|
14
|
+
*
|
|
15
|
+
* The data client is initialized on the client side to avoid serialization issues.
|
|
16
|
+
*
|
|
17
|
+
* Usage in consuming apps:
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // app/register/page.tsx
|
|
20
|
+
* import { RegisterPage } from "hazo_auth/pages/register";
|
|
21
|
+
*
|
|
22
|
+
* export default function Page() {
|
|
23
|
+
* return <RegisterPage />;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Zero configuration required - works out of the box!
|
|
28
|
+
*
|
|
29
|
+
* @param props - Optional visual customization props
|
|
30
|
+
* @returns Server-rendered register page
|
|
31
|
+
*/
|
|
32
|
+
export default function RegisterPage({ image_src, image_alt, image_background_color, } = {}) {
|
|
33
|
+
// Load configuration from INI file (with defaults including asset images)
|
|
34
|
+
const config = get_register_config();
|
|
35
|
+
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
36
|
+
const finalImageSrc = image_src || config.imageSrc;
|
|
37
|
+
const finalImageAlt = image_alt || config.imageAlt;
|
|
38
|
+
const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
|
|
39
|
+
// Pass serializable config to client wrapper
|
|
40
|
+
return (_jsx(RegisterClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, showNameField: config.showNameField, passwordRequirements: config.passwordRequirements, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath, signInPath: config.signInPath, signInLabel: config.signInLabel }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RegisterConfig } from "../lib/register_config.server";
|
|
2
|
+
import type { StaticImageData } from "next/image";
|
|
3
|
+
export type RegisterClientWrapperProps = Omit<RegisterConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor'> & {
|
|
4
|
+
image_src: string | StaticImageData;
|
|
5
|
+
image_alt: string;
|
|
6
|
+
image_background_color: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Client wrapper for RegisterLayout
|
|
10
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
11
|
+
*/
|
|
12
|
+
export declare function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, }: RegisterClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=register_client_wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/register_client_wrapper.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,CAAC,GAAG;IAChH,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAGF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,WAAW,GACZ,EAAE,0BAA0B,2CAqC5B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// file_description: Client wrapper for RegisterLayout - handles data client initialization on client side
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
// section: imports
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import RegisterLayout from "../components/layouts/register";
|
|
7
|
+
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client";
|
|
8
|
+
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup";
|
|
9
|
+
// section: component
|
|
10
|
+
/**
|
|
11
|
+
* Client wrapper for RegisterLayout
|
|
12
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
|
+
*/
|
|
14
|
+
export function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, }) {
|
|
15
|
+
const [dataClient, setDataClient] = useState(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
// Initialize hazo_connect on client side
|
|
18
|
+
const hazoConnect = create_sqlite_hazo_connect();
|
|
19
|
+
const client = createLayoutDataClient(hazoConnect);
|
|
20
|
+
setDataClient(client);
|
|
21
|
+
}, []);
|
|
22
|
+
// Show loading state while initializing
|
|
23
|
+
if (!dataClient) {
|
|
24
|
+
return (_jsx("div", { className: "cls_register_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
25
|
+
}
|
|
26
|
+
return (_jsx(RegisterLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, show_name_field: showNameField, password_requirements: passwordRequirements, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, signInPath: signInPath, signInLabel: signInLabel }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StaticImageData } from "next/image";
|
|
2
|
+
export type ResetPasswordPageProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Optional image source for the visual panel
|
|
5
|
+
* Defaults from hazo_auth_config.ini or package default image
|
|
6
|
+
*/
|
|
7
|
+
image_src?: string | StaticImageData;
|
|
8
|
+
/**
|
|
9
|
+
* Optional image alt text
|
|
10
|
+
* Defaults to "Reset password illustration"
|
|
11
|
+
*/
|
|
12
|
+
image_alt?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional image background color
|
|
15
|
+
* Defaults to "#f1f5f9"
|
|
16
|
+
*/
|
|
17
|
+
image_background_color?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Zero-config ResetPasswordPage server component
|
|
21
|
+
*
|
|
22
|
+
* This component initializes everything server-side:
|
|
23
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
24
|
+
* - Password requirements
|
|
25
|
+
*
|
|
26
|
+
* The data client is initialized on the client side to avoid serialization issues.
|
|
27
|
+
*
|
|
28
|
+
* Usage in consuming apps:
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // app/reset-password/page.tsx
|
|
31
|
+
* import { ResetPasswordPage } from "hazo_auth/pages/reset_password";
|
|
32
|
+
*
|
|
33
|
+
* export default function Page() {
|
|
34
|
+
* return <ResetPasswordPage />;
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* Zero configuration required - works out of the box!
|
|
39
|
+
*
|
|
40
|
+
* @param props - Optional visual customization props
|
|
41
|
+
* @returns Server-rendered reset password page
|
|
42
|
+
*/
|
|
43
|
+
export default function ResetPasswordPage({ image_src, image_alt, image_background_color, }?: ResetPasswordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
//# sourceMappingURL=reset_password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset_password.d.ts","sourceRoot":"","sources":["../../src/server_pages/reset_password.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,SAAS,EACT,SAAS,EACT,sBAAsB,GACvB,GAAE,sBAA2B,2CA2B7B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// file_description: Zero-config ResetPasswordPage server component - drop in and use with no configuration required
|
|
3
|
+
// section: imports
|
|
4
|
+
import { get_reset_password_config } from "../lib/reset_password_config.server";
|
|
5
|
+
import { ResetPasswordClientWrapper } from "./reset_password_client_wrapper";
|
|
6
|
+
// section: component
|
|
7
|
+
/**
|
|
8
|
+
* Zero-config ResetPasswordPage server component
|
|
9
|
+
*
|
|
10
|
+
* This component initializes everything server-side:
|
|
11
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
12
|
+
* - Password requirements
|
|
13
|
+
*
|
|
14
|
+
* The data client is initialized on the client side to avoid serialization issues.
|
|
15
|
+
*
|
|
16
|
+
* Usage in consuming apps:
|
|
17
|
+
* ```tsx
|
|
18
|
+
* // app/reset-password/page.tsx
|
|
19
|
+
* import { ResetPasswordPage } from "hazo_auth/pages/reset_password";
|
|
20
|
+
*
|
|
21
|
+
* export default function Page() {
|
|
22
|
+
* return <ResetPasswordPage />;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Zero configuration required - works out of the box!
|
|
27
|
+
*
|
|
28
|
+
* @param props - Optional visual customization props
|
|
29
|
+
* @returns Server-rendered reset password page
|
|
30
|
+
*/
|
|
31
|
+
export default function ResetPasswordPage({ image_src, image_alt, image_background_color, } = {}) {
|
|
32
|
+
// Load configuration from INI file (with defaults including asset images)
|
|
33
|
+
const config = get_reset_password_config();
|
|
34
|
+
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
35
|
+
const finalImageSrc = image_src || config.imageSrc;
|
|
36
|
+
const finalImageAlt = image_alt || config.imageAlt;
|
|
37
|
+
const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
|
|
38
|
+
// Pass serializable config to client wrapper
|
|
39
|
+
return (_jsx(ResetPasswordClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, passwordRequirements: config.passwordRequirements, errorMessage: config.errorMessage, successMessage: config.successMessage, loginPath: config.loginPath, forgotPasswordPath: config.forgotPasswordPath, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ResetPasswordConfig } from "../lib/reset_password_config.server";
|
|
2
|
+
import type { StaticImageData } from "next/image";
|
|
3
|
+
export type ResetPasswordClientWrapperProps = Omit<ResetPasswordConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor'> & {
|
|
4
|
+
image_src: string | StaticImageData;
|
|
5
|
+
image_alt: string;
|
|
6
|
+
image_background_color: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Client wrapper for ResetPasswordLayout
|
|
10
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
11
|
+
*/
|
|
12
|
+
export declare function ResetPasswordClientWrapper({ image_src, image_alt, image_background_color, passwordRequirements, errorMessage, successMessage, loginPath, forgotPasswordPath, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, }: ResetPasswordClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=reset_password_client_wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset_password_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/reset_password_client_wrapper.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,CAAC,GAAG;IAC1H,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAGF;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,EAAE,+BAA+B,2CAsCjC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// file_description: Client wrapper for ResetPasswordLayout - handles data client initialization on client side
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
// section: imports
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import ResetPasswordLayout from "../components/layouts/reset_password";
|
|
7
|
+
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client";
|
|
8
|
+
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup";
|
|
9
|
+
// section: component
|
|
10
|
+
/**
|
|
11
|
+
* Client wrapper for ResetPasswordLayout
|
|
12
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
|
+
*/
|
|
14
|
+
export function ResetPasswordClientWrapper({ image_src, image_alt, image_background_color, passwordRequirements, errorMessage, successMessage, loginPath, forgotPasswordPath, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, }) {
|
|
15
|
+
const [dataClient, setDataClient] = useState(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
// Initialize hazo_connect on client side
|
|
18
|
+
const hazoConnect = create_sqlite_hazo_connect();
|
|
19
|
+
const client = createLayoutDataClient(hazoConnect);
|
|
20
|
+
setDataClient(client);
|
|
21
|
+
}, []);
|
|
22
|
+
// Show loading state while initializing
|
|
23
|
+
if (!dataClient) {
|
|
24
|
+
return (_jsx("div", { className: "cls_reset_password_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
25
|
+
}
|
|
26
|
+
return (_jsx(ResetPasswordLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, password_requirements: passwordRequirements, errorMessage: errorMessage, successMessage: successMessage, loginPath: loginPath, forgotPasswordPath: forgotPasswordPath, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { StaticImageData } from "next/image";
|
|
2
|
+
export type VerifyEmailPageProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Optional image source for the visual panel
|
|
5
|
+
* Defaults from hazo_auth_config.ini or package default image
|
|
6
|
+
*/
|
|
7
|
+
image_src?: string | StaticImageData;
|
|
8
|
+
/**
|
|
9
|
+
* Optional image alt text
|
|
10
|
+
* Defaults to "Email verification illustration"
|
|
11
|
+
*/
|
|
12
|
+
image_alt?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional image background color
|
|
15
|
+
* Defaults to "#f1f5f9"
|
|
16
|
+
*/
|
|
17
|
+
image_background_color?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional redirect delay in seconds after successful verification
|
|
20
|
+
* Defaults from DEFAULT_EMAIL_VERIFICATION.redirectDelay
|
|
21
|
+
*/
|
|
22
|
+
redirect_delay?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Optional login path for redirect
|
|
25
|
+
* Defaults from DEFAULT_EMAIL_VERIFICATION.loginPath
|
|
26
|
+
*/
|
|
27
|
+
login_path?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Zero-config VerifyEmailPage server component
|
|
31
|
+
*
|
|
32
|
+
* This component initializes everything server-side:
|
|
33
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
34
|
+
*
|
|
35
|
+
* The data client is initialized on the client side to avoid serialization issues.
|
|
36
|
+
*
|
|
37
|
+
* Usage in consuming apps:
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // app/verify-email/page.tsx
|
|
40
|
+
* import { VerifyEmailPage } from "hazo_auth/pages/verify_email";
|
|
41
|
+
*
|
|
42
|
+
* export default function Page() {
|
|
43
|
+
* return <VerifyEmailPage />;
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* Zero configuration required - works out of the box!
|
|
48
|
+
*
|
|
49
|
+
* @param props - Optional visual and behavior customization props
|
|
50
|
+
* @returns Server-rendered email verification page
|
|
51
|
+
*/
|
|
52
|
+
export default function VerifyEmailPage({ image_src, image_alt, image_background_color, redirect_delay, login_path, }?: VerifyEmailPageProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
//# sourceMappingURL=verify_email.d.ts.map
|