hazo_auth 6.1.1 → 7.0.2
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 +65 -167
- package/SETUP_CHECKLIST.md +28 -100
- package/cli-src/cli/generate.ts +1 -10
- package/cli-src/cli/validate.ts +0 -4
- package/cli-src/lib/auth/auth_types.ts +12 -21
- package/cli-src/lib/auth/hazo_get_tenant_auth.server.ts +24 -25
- package/cli-src/lib/auth/index.ts +2 -2
- package/cli-src/lib/auth/nextauth_config.ts +61 -1
- package/cli-src/lib/auth/with_auth.server.ts +15 -15
- package/cli-src/lib/config/default_config.ts +8 -0
- package/cli-src/lib/cookies_config.server.ts +1 -1
- package/cli-src/lib/login_config.server.ts +2 -18
- package/cli-src/lib/oauth_config.server.ts +32 -0
- package/cli-src/lib/register_config.server.ts +4 -0
- package/cli-src/lib/services/email_template_manifest.ts +0 -17
- package/cli-src/lib/services/index.ts +2 -8
- package/cli-src/lib/services/oauth_service.ts +143 -0
- package/cli-src/lib/services/otp_service.ts +7 -2
- package/cli-src/lib/services/session_token_service.ts +0 -2
- package/config/hazo_auth_config.example.ini +0 -38
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +1 -10
- package/dist/cli/validate.d.ts.map +1 -1
- package/dist/cli/validate.js +0 -4
- package/dist/client.d.ts +0 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +0 -1
- package/dist/components/layouts/login/index.d.ts +5 -7
- package/dist/components/layouts/login/index.d.ts.map +1 -1
- package/dist/components/layouts/login/index.js +5 -2
- package/dist/components/layouts/otp/index.d.ts +12 -1
- package/dist/components/layouts/otp/index.d.ts.map +1 -1
- package/dist/components/layouts/otp/index.js +4 -2
- package/dist/components/layouts/register/index.d.ts +4 -0
- package/dist/components/layouts/register/index.d.ts.map +1 -1
- package/dist/components/layouts/register/index.js +4 -1
- package/dist/components/layouts/shared/components/facebook_sign_in_button.d.ts +21 -0
- package/dist/components/layouts/shared/components/facebook_sign_in_button.d.ts.map +1 -0
- package/dist/components/layouts/shared/components/facebook_sign_in_button.js +47 -0
- package/dist/components/layouts/shared/components/sidebar_layout_wrapper.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/sidebar_layout_wrapper.js +3 -8
- package/dist/components/layouts/shared/index.d.ts +2 -0
- package/dist/components/layouts/shared/index.d.ts.map +1 -1
- package/dist/components/layouts/shared/index.js +1 -0
- package/dist/components/layouts/user_management/index.d.ts.map +1 -1
- package/dist/components/layouts/user_management/index.js +39 -2
- package/dist/consent/consent_state.d.ts +18 -0
- package/dist/consent/consent_state.d.ts.map +1 -0
- package/dist/consent/consent_state.js +29 -0
- package/dist/consent/cookie_consent_banner.d.ts +11 -0
- package/dist/consent/cookie_consent_banner.d.ts.map +1 -0
- package/dist/consent/cookie_consent_banner.js +40 -0
- package/dist/consent/gtm_mapping.d.ts +13 -0
- package/dist/consent/gtm_mapping.d.ts.map +1 -0
- package/dist/consent/gtm_mapping.js +30 -0
- package/dist/consent/index.d.ts +7 -0
- package/dist/consent/index.d.ts.map +1 -0
- package/dist/consent/index.js +7 -0
- package/dist/consent/manage_modal.d.ts +2 -0
- package/dist/consent/manage_modal.d.ts.map +1 -0
- package/dist/consent/manage_modal.js +33 -0
- package/dist/consent/read_consent.d.ts +15 -0
- package/dist/consent/read_consent.d.ts.map +1 -0
- package/dist/consent/read_consent.js +23 -0
- package/dist/consent/use_consent.d.ts +7 -0
- package/dist/consent/use_consent.d.ts.map +1 -0
- package/dist/consent/use_consent.js +55 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/auth/auth_types.d.ts +12 -13
- package/dist/lib/auth/auth_types.d.ts.map +1 -1
- package/dist/lib/auth/auth_types.js +0 -8
- package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts +7 -8
- package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_tenant_auth.server.js +22 -23
- package/dist/lib/auth/index.d.ts +2 -2
- package/dist/lib/auth/index.d.ts.map +1 -1
- package/dist/lib/auth/nextauth_config.d.ts.map +1 -1
- package/dist/lib/auth/nextauth_config.js +50 -1
- package/dist/lib/auth/with_auth.server.d.ts +13 -13
- package/dist/lib/auth/with_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/with_auth.server.js +2 -2
- package/dist/lib/config/default_config.d.ts +16 -0
- package/dist/lib/config/default_config.d.ts.map +1 -1
- package/dist/lib/config/default_config.js +8 -0
- package/dist/lib/cookies_config.server.d.ts +1 -1
- package/dist/lib/cookies_config.server.js +1 -1
- package/dist/lib/login_config.server.d.ts +0 -6
- package/dist/lib/login_config.server.d.ts.map +1 -1
- package/dist/lib/login_config.server.js +2 -11
- package/dist/lib/oauth_config.server.d.ts +8 -0
- package/dist/lib/oauth_config.server.d.ts.map +1 -1
- package/dist/lib/oauth_config.server.js +10 -0
- package/dist/lib/register_config.server.d.ts +2 -0
- package/dist/lib/register_config.server.d.ts.map +1 -1
- package/dist/lib/register_config.server.js +2 -0
- package/dist/lib/services/email_template_manifest.d.ts.map +1 -1
- package/dist/lib/services/email_template_manifest.js +0 -17
- package/dist/lib/services/index.d.ts +0 -2
- package/dist/lib/services/index.d.ts.map +1 -1
- package/dist/lib/services/index.js +0 -1
- package/dist/lib/services/oauth_service.d.ts +13 -0
- package/dist/lib/services/oauth_service.d.ts.map +1 -1
- package/dist/lib/services/oauth_service.js +122 -0
- package/dist/lib/services/otp_service.d.ts +1 -1
- package/dist/lib/services/otp_service.d.ts.map +1 -1
- package/dist/lib/services/otp_service.js +6 -1
- package/dist/lib/services/session_token_service.d.ts +0 -2
- package/dist/lib/services/session_token_service.d.ts.map +1 -1
- package/dist/lib/services/session_token_service.js +0 -2
- package/dist/server/routes/assets.d.ts +8 -0
- package/dist/server/routes/assets.d.ts.map +1 -0
- package/dist/server/routes/assets.js +38 -0
- package/dist/server/routes/consent_me.d.ts +4 -0
- package/dist/server/routes/consent_me.d.ts.map +1 -0
- package/dist/server/routes/consent_me.js +15 -0
- package/dist/server/routes/index.d.ts +6 -3
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +9 -4
- package/dist/server/routes/me.d.ts.map +1 -1
- package/dist/server/routes/me.js +1 -43
- package/dist/server/routes/oauth_facebook_callback.d.ts +8 -0
- package/dist/server/routes/oauth_facebook_callback.d.ts.map +1 -0
- package/dist/server/routes/oauth_facebook_callback.js +164 -0
- package/dist/server/routes/otp/verify.js +2 -2
- package/dist/server/routes/strings_defaults.d.ts +4 -0
- package/dist/server/routes/strings_defaults.d.ts.map +1 -0
- package/dist/server/routes/strings_defaults.js +7 -0
- package/dist/server/routes/user_management_users.d.ts +11 -0
- package/dist/server/routes/user_management_users.d.ts.map +1 -1
- package/dist/server/routes/user_management_users.js +50 -0
- package/dist/server-lib.d.ts +0 -3
- package/dist/server-lib.d.ts.map +1 -1
- package/dist/server-lib.js +0 -2
- package/dist/server_pages/forgot_password.d.ts +1 -1
- package/dist/server_pages/forgot_password.d.ts.map +1 -1
- package/dist/server_pages/forgot_password.js +9 -3
- package/dist/server_pages/forgot_password_client_wrapper.d.ts +3 -1
- package/dist/server_pages/forgot_password_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/forgot_password_client_wrapper.js +2 -2
- package/dist/server_pages/index.d.ts +2 -0
- package/dist/server_pages/index.d.ts.map +1 -1
- package/dist/server_pages/index.js +1 -0
- package/dist/server_pages/login.d.ts +1 -1
- package/dist/server_pages/login.d.ts.map +1 -1
- package/dist/server_pages/login.js +12 -3
- package/dist/server_pages/login_client_wrapper.d.ts +4 -1
- package/dist/server_pages/login_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/login_client_wrapper.js +2 -2
- package/dist/server_pages/my_settings.d.ts +1 -1
- package/dist/server_pages/my_settings.d.ts.map +1 -1
- package/dist/server_pages/my_settings.js +1 -2
- package/dist/server_pages/otp.d.ts +16 -2
- package/dist/server_pages/otp.d.ts.map +1 -1
- package/dist/server_pages/otp.js +10 -3
- package/dist/server_pages/register.d.ts +1 -1
- package/dist/server_pages/register.d.ts.map +1 -1
- package/dist/server_pages/register.js +11 -3
- package/dist/server_pages/register_client_wrapper.d.ts +3 -1
- package/dist/server_pages/register_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/register_client_wrapper.js +2 -2
- package/dist/server_pages/reset_password.d.ts +1 -1
- package/dist/server_pages/reset_password.d.ts.map +1 -1
- package/dist/server_pages/reset_password.js +9 -3
- package/dist/server_pages/reset_password_client_wrapper.d.ts +3 -1
- package/dist/server_pages/reset_password_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/reset_password_client_wrapper.js +2 -2
- package/dist/server_pages/verify_email.d.ts +1 -1
- package/dist/server_pages/verify_email.d.ts.map +1 -1
- package/dist/server_pages/verify_email.js +8 -3
- package/dist/server_pages/verify_email_client_wrapper.d.ts +3 -1
- package/dist/server_pages/verify_email_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/verify_email_client_wrapper.js +2 -2
- package/dist/strings/default_strings.d.ts +47 -0
- package/dist/strings/default_strings.d.ts.map +1 -0
- package/dist/strings/default_strings.js +18 -0
- package/dist/strings/index.d.ts +4 -0
- package/dist/strings/index.d.ts.map +1 -0
- package/dist/strings/index.js +3 -0
- package/dist/strings/strings_context.d.ts +12 -0
- package/dist/strings/strings_context.d.ts.map +1 -0
- package/dist/strings/strings_context.js +23 -0
- package/dist/strings/strings_provider.d.ts +26 -0
- package/dist/strings/strings_provider.d.ts.map +1 -0
- package/dist/strings/strings_provider.js +45 -0
- package/dist/theme/create_theme.d.ts +7 -0
- package/dist/theme/create_theme.d.ts.map +1 -0
- package/dist/theme/create_theme.js +97 -0
- package/dist/theme/hex_to_hsl.d.ts +16 -0
- package/dist/theme/hex_to_hsl.d.ts.map +1 -0
- package/dist/theme/hex_to_hsl.js +110 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +3 -0
- package/dist/theme/luminance.d.ts +11 -0
- package/dist/theme/luminance.d.ts.map +1 -0
- package/dist/theme/luminance.js +45 -0
- package/dist/theme/theme_provider.d.ts +14 -0
- package/dist/theme/theme_provider.d.ts.map +1 -0
- package/dist/theme/theme_provider.js +23 -0
- package/dist/theme/theme_types.d.ts +36 -0
- package/dist/theme/theme_types.d.ts.map +1 -0
- package/dist/theme/theme_types.js +1 -0
- package/dist/themes/index.d.ts +2 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +2 -0
- package/dist/themes/preset_neutral.d.ts +3 -0
- package/dist/themes/preset_neutral.d.ts.map +1 -0
- package/dist/themes/preset_neutral.js +14 -0
- package/package.json +25 -22
package/dist/server_pages/otp.js
CHANGED
|
@@ -4,6 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import "server-only";
|
|
5
5
|
import { OTPLayout } from "../components/layouts/otp.js";
|
|
6
6
|
import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
|
|
7
|
+
import { DEFAULT_STRINGS, readStrings } from "../strings.js";
|
|
7
8
|
// section: component
|
|
8
9
|
/**
|
|
9
10
|
* Zero-config OTPPage server component
|
|
@@ -26,13 +27,19 @@ import { AuthPageShell } from "../components/layouts/shared/components/auth_page
|
|
|
26
27
|
* @param props - Optional searchParams and title
|
|
27
28
|
* @returns Server-rendered OTP sign-in page
|
|
28
29
|
*/
|
|
29
|
-
export default async function OTPPage({ searchParams, title, } = {}) {
|
|
30
|
-
var _a;
|
|
30
|
+
export default async function OTPPage({ searchParams, title, subtitle, ctaText, theme, } = {}) {
|
|
31
|
+
var _a, _b, _c, _d;
|
|
31
32
|
const params = searchParams instanceof Promise
|
|
32
33
|
? await searchParams
|
|
33
34
|
: (searchParams !== null && searchParams !== void 0 ? searchParams : {});
|
|
34
35
|
const redirect_url = (_a = params.redirect) !== null && _a !== void 0 ? _a : "/";
|
|
35
|
-
|
|
36
|
+
// Resolve strings: prop > HazoAuthStringsProvider > DEFAULT_STRINGS
|
|
37
|
+
const strings = readStrings();
|
|
38
|
+
const otp_strings = strings.otp;
|
|
39
|
+
const resolved_title = (_b = title !== null && title !== void 0 ? title : otp_strings.title) !== null && _b !== void 0 ? _b : DEFAULT_STRINGS.otp.title;
|
|
40
|
+
const resolved_subtitle = (_c = subtitle !== null && subtitle !== void 0 ? subtitle : otp_strings.subtitle) !== null && _c !== void 0 ? _c : DEFAULT_STRINGS.otp.subtitle;
|
|
41
|
+
const resolved_cta = (_d = ctaText !== null && ctaText !== void 0 ? ctaText : otp_strings.ctaText) !== null && _d !== void 0 ? _d : DEFAULT_STRINGS.otp.ctaText;
|
|
42
|
+
return (_jsx(AuthPageShell, { children: _jsx(OTPLayout, { redirect_url: redirect_url, title: resolved_title, subtitle: resolved_subtitle, ctaText: resolved_cta, theme: theme }) }));
|
|
36
43
|
}
|
|
37
44
|
// Named export for direct imports
|
|
38
45
|
export { OTPPage };
|
|
@@ -48,6 +48,6 @@ export type RegisterPageProps = {
|
|
|
48
48
|
* @param props - Optional visual customization props
|
|
49
49
|
* @returns Server-rendered register page
|
|
50
50
|
*/
|
|
51
|
-
export default function RegisterPage(
|
|
51
|
+
export default function RegisterPage({ image_src, image_alt, image_background_color, layout, }?: RegisterPageProps): import("react/jsx-runtime").JSX.Element;
|
|
52
52
|
export { RegisterPage };
|
|
53
53
|
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/server_pages/register.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/server_pages/register.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAUrB,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;IAEhC;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,MAAqB,GACtB,GAAE,iBAAsB,2CA2DxB;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -6,6 +6,7 @@ import "server-only";
|
|
|
6
6
|
import { get_register_config } from "../lib/register_config.server.js";
|
|
7
7
|
import { get_navbar_config } from "../lib/navbar_config.server.js";
|
|
8
8
|
import { RegisterClientWrapper } from "./register_client_wrapper.js";
|
|
9
|
+
import { readStrings } from "../strings.js";
|
|
9
10
|
import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
|
|
10
11
|
import { FloatingHomeLink } from "../components/layouts/shared/components/floating_home_link.js";
|
|
11
12
|
// section: component
|
|
@@ -34,10 +35,11 @@ import { FloatingHomeLink } from "../components/layouts/shared/components/floati
|
|
|
34
35
|
* @param props - Optional visual customization props
|
|
35
36
|
* @returns Server-rendered register page
|
|
36
37
|
*/
|
|
37
|
-
export default function RegisterPage(
|
|
38
|
-
const { image_src, image_alt, image_background_color, layout = "two_column", } = props !== null && props !== void 0 ? props : {};
|
|
38
|
+
export default function RegisterPage({ image_src, image_alt, image_background_color, layout = "two_column", } = {}) {
|
|
39
39
|
// Load configuration from INI file (with defaults including asset images)
|
|
40
40
|
const config = get_register_config();
|
|
41
|
+
const strings = readStrings();
|
|
42
|
+
const reg_strings = strings.register;
|
|
41
43
|
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
42
44
|
const finalImageSrc = image_src || config.imageSrc;
|
|
43
45
|
const finalImageAlt = image_alt || config.imageAlt;
|
|
@@ -47,7 +49,13 @@ export default function RegisterPage(props) {
|
|
|
47
49
|
enable_email_password: config.oauth.enable_email_password,
|
|
48
50
|
google_button_text: config.oauth.google_button_text,
|
|
49
51
|
oauth_divider_text: config.oauth.oauth_divider_text,
|
|
50
|
-
|
|
52
|
+
enable_facebook_oauth: config.oauth.enable_facebook_oauth,
|
|
53
|
+
facebook_button_text: config.oauth.facebook_button_text,
|
|
54
|
+
}, layout: layout, labels: {
|
|
55
|
+
heading: reg_strings.title,
|
|
56
|
+
subHeading: reg_strings.subtitle,
|
|
57
|
+
submitButton: reg_strings.ctaText,
|
|
58
|
+
} }));
|
|
51
59
|
// form_only mode: skip AuthPageShell so the consumer's own page chrome
|
|
52
60
|
// hosts the form. See LoginPage for the full rationale, including the
|
|
53
61
|
// FloatingHomeLink rendering rule below.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RegisterConfig } from "../lib/register_config.server";
|
|
2
2
|
import type { OAuthLayoutConfig } from "../components/layouts/register/index";
|
|
3
|
+
import type { LayoutLabelOverrides } from "../components/layouts/shared/config/layout_customization";
|
|
3
4
|
import type { StaticImageData } from "next/image";
|
|
4
5
|
export type RegisterClientWrapperProps = Omit<RegisterConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor' | 'oauth'> & {
|
|
5
6
|
image_src?: string | StaticImageData;
|
|
@@ -9,10 +10,11 @@ export type RegisterClientWrapperProps = Omit<RegisterConfig, 'imageSrc' | 'imag
|
|
|
9
10
|
oauth?: OAuthLayoutConfig;
|
|
10
11
|
/** Layout mode — see RegisterLayoutProps.layout. Default `"two_column"`. */
|
|
11
12
|
layout?: "two_column" | "form_only";
|
|
13
|
+
labels?: LayoutLabelOverrides;
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
16
|
* Client wrapper for RegisterLayout
|
|
15
17
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
16
18
|
*/
|
|
17
|
-
export declare function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, layout, }: RegisterClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, layout, labels, }: RegisterClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
//# sourceMappingURL=register_client_wrapper.d.ts.map
|
|
@@ -1 +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;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;
|
|
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;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAGrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,GAAG,OAAO,CAAC,GAAG;IAC1H,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IACpC,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B,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,EACX,KAAK,EACL,MAAqB,EACrB,MAAM,GACP,EAAE,0BAA0B,2CAwC5B"}
|
|
@@ -11,7 +11,7 @@ import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
|
11
11
|
* Client wrapper for RegisterLayout
|
|
12
12
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
13
|
*/
|
|
14
|
-
export function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, layout = "two_column", }) {
|
|
14
|
+
export function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, layout = "two_column", labels, }) {
|
|
15
15
|
const [dataClient, setDataClient] = useState(null);
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
// Initialize hazo_connect on client side
|
|
@@ -23,5 +23,5 @@ export function RegisterClientWrapper({ image_src, image_alt, image_background_c
|
|
|
23
23
|
if (!dataClient) {
|
|
24
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
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, oauth: oauth, layout: layout }));
|
|
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, oauth: oauth, layout: layout, labels: labels }));
|
|
27
27
|
}
|
|
@@ -41,6 +41,6 @@ export type ResetPasswordPageProps = {
|
|
|
41
41
|
* @param props - Optional visual customization props
|
|
42
42
|
* @returns Server-rendered reset password page
|
|
43
43
|
*/
|
|
44
|
-
export default function ResetPasswordPage(
|
|
44
|
+
export default function ResetPasswordPage({ image_src, image_alt, image_background_color, }?: ResetPasswordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
export { ResetPasswordPage };
|
|
46
46
|
//# sourceMappingURL=reset_password.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset_password.d.ts","sourceRoot":"","sources":["../../src/server_pages/reset_password.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"reset_password.d.ts","sourceRoot":"","sources":["../../src/server_pages/reset_password.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,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,2CAqC7B;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -5,6 +5,7 @@ import "server-only";
|
|
|
5
5
|
// section: imports
|
|
6
6
|
import { get_reset_password_config } from "../lib/reset_password_config.server.js";
|
|
7
7
|
import { ResetPasswordClientWrapper } from "./reset_password_client_wrapper.js";
|
|
8
|
+
import { readStrings } from "../strings.js";
|
|
8
9
|
import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
|
|
9
10
|
// section: component
|
|
10
11
|
/**
|
|
@@ -31,16 +32,21 @@ import { AuthPageShell } from "../components/layouts/shared/components/auth_page
|
|
|
31
32
|
* @param props - Optional visual customization props
|
|
32
33
|
* @returns Server-rendered reset password page
|
|
33
34
|
*/
|
|
34
|
-
export default function ResetPasswordPage(
|
|
35
|
-
const { image_src, image_alt, image_background_color, } = props !== null && props !== void 0 ? props : {};
|
|
35
|
+
export default function ResetPasswordPage({ image_src, image_alt, image_background_color, } = {}) {
|
|
36
36
|
// Load configuration from INI file (with defaults including asset images)
|
|
37
37
|
const config = get_reset_password_config();
|
|
38
|
+
const strings = readStrings();
|
|
39
|
+
const rp_strings = strings.reset_password;
|
|
38
40
|
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
39
41
|
const finalImageSrc = image_src || config.imageSrc;
|
|
40
42
|
const finalImageAlt = image_alt || config.imageAlt;
|
|
41
43
|
const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
|
|
42
44
|
// Pass serializable config to client wrapper, wrapped in AuthPageShell for navbar support
|
|
43
|
-
return (_jsx(AuthPageShell, { children: _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
|
|
45
|
+
return (_jsx(AuthPageShell, { children: _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, labels: {
|
|
46
|
+
heading: rp_strings.title,
|
|
47
|
+
subHeading: rp_strings.subtitle,
|
|
48
|
+
submitButton: rp_strings.ctaText,
|
|
49
|
+
} }) }));
|
|
44
50
|
}
|
|
45
51
|
// Named export for direct imports
|
|
46
52
|
export { ResetPasswordPage };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { ResetPasswordConfig } from "../lib/reset_password_config.server";
|
|
2
|
+
import type { LayoutLabelOverrides } from "../components/layouts/shared/config/layout_customization";
|
|
2
3
|
import type { StaticImageData } from "next/image";
|
|
3
4
|
export type ResetPasswordClientWrapperProps = Omit<ResetPasswordConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor'> & {
|
|
4
5
|
image_src: string | StaticImageData;
|
|
5
6
|
image_alt: string;
|
|
6
7
|
image_background_color: string;
|
|
8
|
+
labels?: LayoutLabelOverrides;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
11
|
* Client wrapper for ResetPasswordLayout
|
|
10
12
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
11
13
|
*/
|
|
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;
|
|
14
|
+
export declare function ResetPasswordClientWrapper({ image_src, image_alt, image_background_color, passwordRequirements, errorMessage, successMessage, loginPath, forgotPasswordPath, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, labels, }: ResetPasswordClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
//# sourceMappingURL=reset_password_client_wrapper.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAGrG,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;IAC/B,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B,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,EACd,MAAM,GACP,EAAE,+BAA+B,2CAuCjC"}
|
|
@@ -11,7 +11,7 @@ import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
|
11
11
|
* Client wrapper for ResetPasswordLayout
|
|
12
12
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
13
|
*/
|
|
14
|
-
export function ResetPasswordClientWrapper({ image_src, image_alt, image_background_color, passwordRequirements, errorMessage, successMessage, loginPath, forgotPasswordPath, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, }) {
|
|
14
|
+
export function ResetPasswordClientWrapper({ image_src, image_alt, image_background_color, passwordRequirements, errorMessage, successMessage, loginPath, forgotPasswordPath, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, labels, }) {
|
|
15
15
|
const [dataClient, setDataClient] = useState(null);
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
// Initialize hazo_connect on client side
|
|
@@ -23,5 +23,5 @@ export function ResetPasswordClientWrapper({ image_src, image_alt, image_backgro
|
|
|
23
23
|
if (!dataClient) {
|
|
24
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
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 }));
|
|
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, labels: labels }));
|
|
27
27
|
}
|
|
@@ -50,6 +50,6 @@ export type VerifyEmailPageProps = {
|
|
|
50
50
|
* @param props - Optional visual and behavior customization props
|
|
51
51
|
* @returns Server-rendered email verification page
|
|
52
52
|
*/
|
|
53
|
-
export default function VerifyEmailPage(
|
|
53
|
+
export default function VerifyEmailPage({ image_src, image_alt, image_background_color, redirect_delay, login_path, }?: VerifyEmailPageProps): import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
export { VerifyEmailPage };
|
|
55
55
|
//# sourceMappingURL=verify_email.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify_email.d.ts","sourceRoot":"","sources":["../../src/server_pages/verify_email.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"verify_email.d.ts","sourceRoot":"","sources":["../../src/server_pages/verify_email.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB,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,2CAiC3B;AAGD,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -5,6 +5,7 @@ import "server-only";
|
|
|
5
5
|
// section: imports
|
|
6
6
|
import { get_email_verification_config } from "../lib/email_verification_config.server.js";
|
|
7
7
|
import { VerifyEmailClientWrapper } from "./verify_email_client_wrapper.js";
|
|
8
|
+
import { readStrings } from "../strings.js";
|
|
8
9
|
import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
|
|
9
10
|
import { DEFAULT_EMAIL_VERIFICATION } from "../lib/config/default_config.js";
|
|
10
11
|
// section: component
|
|
@@ -31,16 +32,20 @@ import { DEFAULT_EMAIL_VERIFICATION } from "../lib/config/default_config.js";
|
|
|
31
32
|
* @param props - Optional visual and behavior customization props
|
|
32
33
|
* @returns Server-rendered email verification page
|
|
33
34
|
*/
|
|
34
|
-
export default function VerifyEmailPage(
|
|
35
|
-
const { image_src, image_alt, image_background_color, redirect_delay = DEFAULT_EMAIL_VERIFICATION.redirectDelay, login_path = DEFAULT_EMAIL_VERIFICATION.loginPath, } = props !== null && props !== void 0 ? props : {};
|
|
35
|
+
export default function VerifyEmailPage({ image_src, image_alt, image_background_color, redirect_delay = DEFAULT_EMAIL_VERIFICATION.redirectDelay, login_path = DEFAULT_EMAIL_VERIFICATION.loginPath, } = {}) {
|
|
36
36
|
// Load configuration from INI file (with defaults including asset images)
|
|
37
37
|
const config = get_email_verification_config();
|
|
38
|
+
const strings = readStrings();
|
|
39
|
+
const ve_strings = strings.verify_email;
|
|
38
40
|
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
39
41
|
const finalImageSrc = image_src || config.imageSrc;
|
|
40
42
|
const finalImageAlt = image_alt || config.imageAlt;
|
|
41
43
|
const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
|
|
42
44
|
// Pass serializable config to client wrapper, wrapped in AuthPageShell for navbar support
|
|
43
|
-
return (_jsx(AuthPageShell, { children: _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
|
|
45
|
+
return (_jsx(AuthPageShell, { children: _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, labels: {
|
|
46
|
+
heading: ve_strings.title,
|
|
47
|
+
subHeading: ve_strings.subtitle,
|
|
48
|
+
} }) }));
|
|
44
49
|
}
|
|
45
50
|
// Named export for direct imports
|
|
46
51
|
export { VerifyEmailPage };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EmailVerificationConfig } from "../lib/email_verification_config.server";
|
|
2
|
+
import type { LayoutLabelOverrides } from "../components/layouts/shared/config/layout_customization";
|
|
2
3
|
import type { StaticImageData } from "next/image";
|
|
3
4
|
export type VerifyEmailClientWrapperProps = Omit<EmailVerificationConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor'> & {
|
|
4
5
|
image_src: string | StaticImageData;
|
|
@@ -6,10 +7,11 @@ export type VerifyEmailClientWrapperProps = Omit<EmailVerificationConfig, 'image
|
|
|
6
7
|
image_background_color: string;
|
|
7
8
|
redirect_delay: number;
|
|
8
9
|
login_path: string;
|
|
10
|
+
labels?: LayoutLabelOverrides;
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* Client wrapper for EmailVerificationLayout
|
|
12
14
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
15
|
*/
|
|
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;
|
|
16
|
+
export declare function VerifyEmailClientWrapper({ image_src, image_alt, image_background_color, redirect_delay, login_path, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, labels, }: VerifyEmailClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
//# sourceMappingURL=verify_email_client_wrapper.d.ts.map
|
|
@@ -1 +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;
|
|
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;AACvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAGrG,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;IACnB,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B,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,EACd,MAAM,GACP,EAAE,6BAA6B,2CAqC/B"}
|
|
@@ -11,7 +11,7 @@ import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
|
11
11
|
* Client wrapper for EmailVerificationLayout
|
|
12
12
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
13
|
*/
|
|
14
|
-
export function VerifyEmailClientWrapper({ image_src, image_alt, image_background_color, redirect_delay, login_path, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, }) {
|
|
14
|
+
export function VerifyEmailClientWrapper({ image_src, image_alt, image_background_color, redirect_delay, login_path, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, labels, }) {
|
|
15
15
|
const [dataClient, setDataClient] = useState(null);
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
// Initialize hazo_connect on client side
|
|
@@ -23,5 +23,5 @@ export function VerifyEmailClientWrapper({ image_src, image_alt, image_backgroun
|
|
|
23
23
|
if (!dataClient) {
|
|
24
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
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 }));
|
|
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, labels: labels }));
|
|
27
27
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface HazoAuthStrings {
|
|
3
|
+
login: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle: string;
|
|
6
|
+
ctaText: string;
|
|
7
|
+
legalText: ReactNode;
|
|
8
|
+
errors?: {
|
|
9
|
+
link_blocked_unverified?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
register: {
|
|
13
|
+
title: string;
|
|
14
|
+
subtitle: string;
|
|
15
|
+
ctaText: string;
|
|
16
|
+
legalText: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
forgot_password: {
|
|
19
|
+
title: string;
|
|
20
|
+
subtitle: string;
|
|
21
|
+
ctaText: string;
|
|
22
|
+
};
|
|
23
|
+
reset_password: {
|
|
24
|
+
title: string;
|
|
25
|
+
subtitle: string;
|
|
26
|
+
ctaText: string;
|
|
27
|
+
};
|
|
28
|
+
verify_email: {
|
|
29
|
+
title: string;
|
|
30
|
+
subtitle: string;
|
|
31
|
+
};
|
|
32
|
+
otp: {
|
|
33
|
+
title: string;
|
|
34
|
+
subtitle: string;
|
|
35
|
+
ctaText: string;
|
|
36
|
+
};
|
|
37
|
+
my_settings: {
|
|
38
|
+
title: string;
|
|
39
|
+
};
|
|
40
|
+
create_firm: {
|
|
41
|
+
title: string;
|
|
42
|
+
subtitle: string;
|
|
43
|
+
ctaText: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export declare const DEFAULT_STRINGS: HazoAuthStrings;
|
|
47
|
+
//# sourceMappingURL=default_strings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default_strings.d.ts","sourceRoot":"","sources":["../../src/strings/default_strings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,SAAS,CAAC;QACrB,MAAM,CAAC,EAAE;YACP,uBAAuB,CAAC,EAAE,MAAM,CAAC;SAClC,CAAC;KACH,CAAC;IACF,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,SAAS,CAAA;KAAE,CAAC;IACrF,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE,cAAc,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnE;AAED,eAAO,MAAM,eAAe,EAAE,eAiB7B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const DEFAULT_STRINGS = {
|
|
2
|
+
login: {
|
|
3
|
+
title: "Sign in to your account",
|
|
4
|
+
subtitle: "Enter your credentials to access your secure workspace.",
|
|
5
|
+
ctaText: "Login",
|
|
6
|
+
legalText: "",
|
|
7
|
+
errors: {
|
|
8
|
+
link_blocked_unverified: "This email is already registered but not verified. Please verify your email before linking a social account.",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
register: { title: "Create your hazo account", subtitle: "Secure your access with editable fields powered by shadcn components.", ctaText: "Register", legalText: "" },
|
|
12
|
+
forgot_password: { title: "Forgot your password?", subtitle: "Enter your email address and we'll send you a link to reset your password.", ctaText: "Send reset link" },
|
|
13
|
+
reset_password: { title: "Reset your password", subtitle: "Enter your new password below.", ctaText: "Reset password" },
|
|
14
|
+
verify_email: { title: "Email verification", subtitle: "Verifying your email address..." },
|
|
15
|
+
otp: { title: "Sign in with email code", subtitle: "Enter the code we sent to your email", ctaText: "Verify" },
|
|
16
|
+
my_settings: { title: "Account Settings" },
|
|
17
|
+
create_firm: { title: "Create Your Firm", subtitle: "Set up your organisation to get started", ctaText: "Create Firm" },
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/strings/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HazoAuthStrings } from "./default_strings.js";
|
|
2
|
+
/**
|
|
3
|
+
* Write the resolved strings into the per-request store.
|
|
4
|
+
* Called by HazoAuthStringsProvider during the render of its parent Server Component.
|
|
5
|
+
*/
|
|
6
|
+
export declare function setStrings(strings: HazoAuthStrings): void;
|
|
7
|
+
/**
|
|
8
|
+
* Read the current resolved strings from the per-request store.
|
|
9
|
+
* Falls back to DEFAULT_STRINGS if HazoAuthStringsProvider was not mounted.
|
|
10
|
+
*/
|
|
11
|
+
export declare function readStrings(): HazoAuthStrings;
|
|
12
|
+
//# sourceMappingURL=strings_context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings_context.d.ts","sourceRoot":"","sources":["../../src/strings/strings_context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAS1E;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAEzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,eAAe,CAE7C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// file_description: per-request strings cache using React cache() for Server Component support
|
|
2
|
+
import { cache } from "react";
|
|
3
|
+
import { DEFAULT_STRINGS } from "./default_strings.js";
|
|
4
|
+
/**
|
|
5
|
+
* Per-request store for resolved strings.
|
|
6
|
+
* React.cache() creates one instance per request in the React tree.
|
|
7
|
+
* Server Components can read this without prop-drilling.
|
|
8
|
+
*/
|
|
9
|
+
const getStringsStore = cache(() => ({ strings: DEFAULT_STRINGS }));
|
|
10
|
+
/**
|
|
11
|
+
* Write the resolved strings into the per-request store.
|
|
12
|
+
* Called by HazoAuthStringsProvider during the render of its parent Server Component.
|
|
13
|
+
*/
|
|
14
|
+
export function setStrings(strings) {
|
|
15
|
+
getStringsStore().strings = strings;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Read the current resolved strings from the per-request store.
|
|
19
|
+
* Falls back to DEFAULT_STRINGS if HazoAuthStringsProvider was not mounted.
|
|
20
|
+
*/
|
|
21
|
+
export function readStrings() {
|
|
22
|
+
return getStringsStore().strings;
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { HazoAuthStrings } from "./default_strings";
|
|
3
|
+
type DeepPartial<T> = T extends object ? {
|
|
4
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
5
|
+
} : T;
|
|
6
|
+
/**
|
|
7
|
+
* Server Component that registers custom string overrides for all descendant
|
|
8
|
+
* hazo_auth page components rendered in the same React request.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <HazoAuthStringsProvider
|
|
13
|
+
* strings={{ login: { title: "Welcome back", ctaText: "Log in" } }}
|
|
14
|
+
* >
|
|
15
|
+
* <LoginPage />
|
|
16
|
+
* </HazoAuthStringsProvider>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Any field not supplied falls back to DEFAULT_STRINGS.
|
|
20
|
+
*/
|
|
21
|
+
export declare function HazoAuthStringsProvider({ strings, children, }: {
|
|
22
|
+
strings?: DeepPartial<HazoAuthStrings>;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=strings_provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings_provider.d.ts","sourceRoot":"","sources":["../../src/strings/strings_provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMzD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAClC;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtC,CAAC,CAAC;AA2BN;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,QAAQ,GACT,EAAE;IACD,OAAO,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAMA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_STRINGS } from "./default_strings.js";
|
|
3
|
+
import { setStrings } from "./strings_context.js";
|
|
4
|
+
function deep_merge(base, overrides) {
|
|
5
|
+
const result = Object.assign({}, base);
|
|
6
|
+
const ov = overrides;
|
|
7
|
+
for (const key in ov) {
|
|
8
|
+
const override_val = ov[key];
|
|
9
|
+
const base_val = base[key];
|
|
10
|
+
if (override_val !== undefined &&
|
|
11
|
+
override_val !== null &&
|
|
12
|
+
typeof override_val === "object" &&
|
|
13
|
+
!Array.isArray(override_val) &&
|
|
14
|
+
typeof base_val === "object" &&
|
|
15
|
+
base_val !== null) {
|
|
16
|
+
result[key] = deep_merge(base_val, override_val);
|
|
17
|
+
}
|
|
18
|
+
else if (override_val !== undefined) {
|
|
19
|
+
result[key] = override_val;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Server Component that registers custom string overrides for all descendant
|
|
26
|
+
* hazo_auth page components rendered in the same React request.
|
|
27
|
+
*
|
|
28
|
+
* Usage:
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <HazoAuthStringsProvider
|
|
31
|
+
* strings={{ login: { title: "Welcome back", ctaText: "Log in" } }}
|
|
32
|
+
* >
|
|
33
|
+
* <LoginPage />
|
|
34
|
+
* </HazoAuthStringsProvider>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Any field not supplied falls back to DEFAULT_STRINGS.
|
|
38
|
+
*/
|
|
39
|
+
export function HazoAuthStringsProvider({ strings, children, }) {
|
|
40
|
+
const resolved = strings
|
|
41
|
+
? deep_merge(DEFAULT_STRINGS, strings)
|
|
42
|
+
: DEFAULT_STRINGS;
|
|
43
|
+
setStrings(resolved);
|
|
44
|
+
return _jsx(_Fragment, { children: children });
|
|
45
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HazoAuthTheme } from "./theme_types";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a fully-resolved HazoAuthTheme from a partial input, applying defaults
|
|
4
|
+
* from preset_neutral. Computes all shadcn CSS variable overrides.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createTheme(input: Partial<HazoAuthTheme>): HazoAuthTheme;
|
|
7
|
+
//# sourceMappingURL=create_theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create_theme.d.ts","sourceRoot":"","sources":["../../src/theme/create_theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAKnD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CA6ExE"}
|