hazo_auth 1.6.7 → 3.0.1
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 +114 -14
- package/SETUP_CHECKLIST.md +65 -1
- 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 +3 -1
- 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/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/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_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 +34 -10
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify_email.d.ts","sourceRoot":"","sources":["../../src/server_pages/verify_email.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;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;IAEhC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,cAAyD,EACzD,UAAiD,GAClD,GAAE,oBAAyB,2CAwB3B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// file_description: Zero-config VerifyEmailPage server component - drop in and use with no configuration required
|
|
3
|
+
// section: imports
|
|
4
|
+
import { get_email_verification_config } from "../lib/email_verification_config.server";
|
|
5
|
+
import { VerifyEmailClientWrapper } from "./verify_email_client_wrapper";
|
|
6
|
+
import { DEFAULT_EMAIL_VERIFICATION } from "../lib/config/default_config";
|
|
7
|
+
// section: component
|
|
8
|
+
/**
|
|
9
|
+
* Zero-config VerifyEmailPage server component
|
|
10
|
+
*
|
|
11
|
+
* This component initializes everything server-side:
|
|
12
|
+
* - Configuration from hazo_auth_config.ini (with sensible defaults)
|
|
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/verify-email/page.tsx
|
|
19
|
+
* import { VerifyEmailPage } from "hazo_auth/pages/verify_email";
|
|
20
|
+
*
|
|
21
|
+
* export default function Page() {
|
|
22
|
+
* return <VerifyEmailPage />;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Zero configuration required - works out of the box!
|
|
27
|
+
*
|
|
28
|
+
* @param props - Optional visual and behavior customization props
|
|
29
|
+
* @returns Server-rendered email verification page
|
|
30
|
+
*/
|
|
31
|
+
export default function VerifyEmailPage({ image_src, image_alt, image_background_color, redirect_delay = DEFAULT_EMAIL_VERIFICATION.redirectDelay, login_path = DEFAULT_EMAIL_VERIFICATION.loginPath, } = {}) {
|
|
32
|
+
// Load configuration from INI file (with defaults including asset images)
|
|
33
|
+
const config = get_email_verification_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(VerifyEmailClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, redirect_delay: redirect_delay, login_path: login_path, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EmailVerificationConfig } from "../lib/email_verification_config.server";
|
|
2
|
+
import type { StaticImageData } from "next/image";
|
|
3
|
+
export type VerifyEmailClientWrapperProps = Omit<EmailVerificationConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor'> & {
|
|
4
|
+
image_src: string | StaticImageData;
|
|
5
|
+
image_alt: string;
|
|
6
|
+
image_background_color: string;
|
|
7
|
+
redirect_delay: number;
|
|
8
|
+
login_path: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Client wrapper for EmailVerificationLayout
|
|
12
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
|
+
*/
|
|
14
|
+
export declare function VerifyEmailClientWrapper({ image_src, image_alt, image_background_color, redirect_delay, login_path, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, }: VerifyEmailClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=verify_email_client_wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify_email_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/verify_email_client_wrapper.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,uBAAuB,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,CAAC,GAAG;IAC5H,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,EAAE,6BAA6B,2CAoC/B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// file_description: Client wrapper for EmailVerificationLayout - 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 EmailVerificationLayout from "../components/layouts/email_verification";
|
|
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 EmailVerificationLayout
|
|
12
|
+
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
|
+
*/
|
|
14
|
+
export function VerifyEmailClientWrapper({ image_src, image_alt, image_background_color, redirect_delay, login_path, 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_verify_email_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(EmailVerificationLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, redirect_delay: redirect_delay, login_path: login_path, sign_in_label: "Back to login", already_logged_in_message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath }));
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -65,32 +65,56 @@
|
|
|
65
65
|
"import": "./dist/server/middleware.js"
|
|
66
66
|
},
|
|
67
67
|
"./pages": {
|
|
68
|
+
"types": "./dist/server_pages/index.d.ts",
|
|
69
|
+
"import": "./dist/server_pages/index.js"
|
|
70
|
+
},
|
|
71
|
+
"./pages/login": {
|
|
72
|
+
"types": "./dist/server_pages/login.d.ts",
|
|
73
|
+
"import": "./dist/server_pages/login.js"
|
|
74
|
+
},
|
|
75
|
+
"./pages/register": {
|
|
76
|
+
"types": "./dist/server_pages/register.d.ts",
|
|
77
|
+
"import": "./dist/server_pages/register.js"
|
|
78
|
+
},
|
|
79
|
+
"./pages/forgot_password": {
|
|
80
|
+
"types": "./dist/server_pages/forgot_password.d.ts",
|
|
81
|
+
"import": "./dist/server_pages/forgot_password.js"
|
|
82
|
+
},
|
|
83
|
+
"./pages/reset_password": {
|
|
84
|
+
"types": "./dist/server_pages/reset_password.d.ts",
|
|
85
|
+
"import": "./dist/server_pages/reset_password.js"
|
|
86
|
+
},
|
|
87
|
+
"./pages/verify_email": {
|
|
88
|
+
"types": "./dist/server_pages/verify_email.d.ts",
|
|
89
|
+
"import": "./dist/server_pages/verify_email.js"
|
|
90
|
+
},
|
|
91
|
+
"./pages/my_settings": {
|
|
92
|
+
"types": "./dist/server_pages/my_settings.d.ts",
|
|
93
|
+
"import": "./dist/server_pages/my_settings.js"
|
|
94
|
+
},
|
|
95
|
+
"./page_components": {
|
|
68
96
|
"types": "./dist/page_components/index.d.ts",
|
|
69
97
|
"import": "./dist/page_components/index.js"
|
|
70
98
|
},
|
|
71
|
-
"./
|
|
99
|
+
"./page_components/login": {
|
|
72
100
|
"types": "./dist/page_components/login.d.ts",
|
|
73
101
|
"import": "./dist/page_components/login.js"
|
|
74
102
|
},
|
|
75
|
-
"./
|
|
103
|
+
"./page_components/register": {
|
|
76
104
|
"types": "./dist/page_components/register.d.ts",
|
|
77
105
|
"import": "./dist/page_components/register.js"
|
|
78
106
|
},
|
|
79
|
-
"./
|
|
107
|
+
"./page_components/forgot_password": {
|
|
80
108
|
"types": "./dist/page_components/forgot_password.d.ts",
|
|
81
109
|
"import": "./dist/page_components/forgot_password.js"
|
|
82
110
|
},
|
|
83
|
-
"./
|
|
111
|
+
"./page_components/reset_password": {
|
|
84
112
|
"types": "./dist/page_components/reset_password.d.ts",
|
|
85
113
|
"import": "./dist/page_components/reset_password.js"
|
|
86
114
|
},
|
|
87
|
-
"./
|
|
115
|
+
"./page_components/verify_email": {
|
|
88
116
|
"types": "./dist/page_components/verify_email.d.ts",
|
|
89
117
|
"import": "./dist/page_components/verify_email.js"
|
|
90
|
-
},
|
|
91
|
-
"./pages/my_settings": {
|
|
92
|
-
"types": "./dist/page_components/my_settings.d.ts",
|
|
93
|
-
"import": "./dist/page_components/my_settings.js"
|
|
94
118
|
}
|
|
95
119
|
},
|
|
96
120
|
"files": [
|