hazo_auth 10.8.2 → 10.11.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 +40 -0
- package/SETUP_CHECKLIST.md +49 -0
- package/cli-src/cli/generate.ts +1 -0
- package/cli-src/lib/auth/with_auth.server.ts +65 -23
- package/cli-src/lib/cookies_config.server.ts +50 -0
- package/cli-src/lib/my_settings_config.server.ts +5 -1
- package/cli-src/lib/services/account_deletion_service.ts +67 -0
- package/cli-src/lib/services/index.ts +1 -0
- package/config/hazo_auth_config.example.ini +25 -19
- package/dist/admin-issues/install_permission_ux.server.d.ts +26 -0
- package/dist/admin-issues/install_permission_ux.server.d.ts.map +1 -0
- package/dist/admin-issues/install_permission_ux.server.js +27 -0
- package/dist/admin-issues/permission_denied_provider.client.d.ts +19 -0
- package/dist/admin-issues/permission_denied_provider.client.d.ts.map +1 -1
- package/dist/admin-issues/permission_denied_provider.client.js +46 -2
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +1 -0
- package/dist/client.d.ts +2 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/components/layouts/my_settings/components/danger_zone_section.d.ts +34 -0
- package/dist/components/layouts/my_settings/components/danger_zone_section.d.ts.map +1 -0
- package/dist/components/layouts/my_settings/components/danger_zone_section.js +93 -0
- package/dist/components/layouts/my_settings/index.d.ts +6 -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/permission_denied_dialog.client.js +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/hooks.d.ts +5 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +29 -0
- package/dist/lib/auth/with_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/with_auth.server.js +51 -15
- package/dist/lib/cookies_config.server.d.ts +20 -0
- package/dist/lib/cookies_config.server.d.ts.map +1 -1
- package/dist/lib/cookies_config.server.js +43 -0
- package/dist/lib/my_settings_config.server.d.ts +2 -0
- package/dist/lib/my_settings_config.server.d.ts.map +1 -1
- package/dist/lib/my_settings_config.server.js +3 -1
- package/dist/lib/services/account_deletion_service.d.ts +22 -0
- package/dist/lib/services/account_deletion_service.d.ts.map +1 -0
- package/dist/lib/services/account_deletion_service.js +55 -0
- package/dist/lib/services/index.d.ts +1 -0
- package/dist/lib/services/index.d.ts.map +1 -1
- package/dist/lib/services/index.js +1 -0
- package/dist/page_components/my_settings.d.ts +6 -1
- package/dist/page_components/my_settings.d.ts.map +1 -1
- package/dist/page_components/my_settings.js +2 -2
- package/dist/server/routes/delete_account.d.ts +17 -0
- package/dist/server/routes/delete_account.d.ts.map +1 -0
- package/dist/server/routes/delete_account.js +107 -0
- package/dist/server/routes/index.d.ts +1 -0
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +1 -0
- package/dist/server/routes/logout.d.ts.map +1 -1
- package/dist/server/routes/logout.js +4 -40
- package/dist/server-lib.d.ts +2 -0
- package/dist/server-lib.d.ts.map +1 -1
- package/dist/server-lib.js +1 -0
- package/dist/server_pages/my_settings.d.ts.map +1 -1
- package/dist/server_pages/my_settings.js +1 -1
- package/package.json +15 -11
- package/dist/page_components/forgot_password.d.ts +0 -19
- package/dist/page_components/forgot_password.d.ts.map +0 -1
- package/dist/page_components/forgot_password.js +0 -50
- package/dist/page_components/login.d.ts +0 -30
- package/dist/page_components/login.d.ts.map +0 -1
- package/dist/page_components/login.js +0 -50
- package/dist/page_components/register.d.ts +0 -25
- package/dist/page_components/register.d.ts.map +0 -1
- package/dist/page_components/register.js +0 -57
- package/dist/page_components/reset_password.d.ts +0 -25
- package/dist/page_components/reset_password.d.ts.map +0 -1
- package/dist/page_components/reset_password.js +0 -57
- package/dist/page_components/verify_email.d.ts +0 -21
- package/dist/page_components/verify_email.d.ts.map +0 -1
- package/dist/page_components/verify_email.js +0 -50
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// file_description: zero-config login page component for hazo_auth
|
|
2
|
-
// Consumers can use this directly without needing to configure props
|
|
3
|
-
//
|
|
4
|
-
// ⚠️ DEPRECATED: This client component is deprecated in hazo_auth v2.0+
|
|
5
|
-
// Please use the new server component version instead:
|
|
6
|
-
//
|
|
7
|
-
// import { LoginPage } from "hazo_auth/pages/login";
|
|
8
|
-
//
|
|
9
|
-
// The new version:
|
|
10
|
-
// - Initializes on the server (no loading state)
|
|
11
|
-
// - Works with your app's hazo_connect instance
|
|
12
|
-
// - True zero-config "drop in and use"
|
|
13
|
-
// - Better performance (smaller bundle)
|
|
14
|
-
//
|
|
15
|
-
// This file will be removed in v3.0
|
|
16
|
-
//
|
|
17
|
-
"use client";
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
// section: imports
|
|
20
|
-
import { useEffect, useState } from "react";
|
|
21
|
-
import login_layout from "../components/layouts/login/index.js";
|
|
22
|
-
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
|
-
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/login_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
28
|
-
// section: component
|
|
29
|
-
/**
|
|
30
|
-
* Zero-config login page component
|
|
31
|
-
* Uses sensible defaults and can be customized via props
|
|
32
|
-
* @param props - Optional configuration overrides
|
|
33
|
-
* @returns Login page component
|
|
34
|
-
*/
|
|
35
|
-
export function LoginPage({ redirectRoute, successMessage = "Successfully logged in", alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", forgotPasswordPath = "/hazo_auth/forgot_password", forgotPasswordLabel = "Forgot password?", createAccountPath = "/hazo_auth/register", createAccountLabel = "Create account", urlOnLogon, imageSrc = DEFAULT_IMAGE_SRC, imageAlt = DEFAULT_IMAGE_ALT, imageBackgroundColor = DEFAULT_IMAGE_BG, } = {}) {
|
|
36
|
-
const [dataClient, setDataClient] = useState(null);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
// Initialize hazo_connect on client side
|
|
39
|
-
const hazoConnect = create_sqlite_hazo_connect();
|
|
40
|
-
const client = createLayoutDataClient(hazoConnect);
|
|
41
|
-
setDataClient(client);
|
|
42
|
-
}, []);
|
|
43
|
-
// Show loading state while initializing
|
|
44
|
-
if (!dataClient) {
|
|
45
|
-
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..." }) }));
|
|
46
|
-
}
|
|
47
|
-
const LoginLayout = login_layout;
|
|
48
|
-
return (_jsx(LoginLayout, { image_src: imageSrc, image_alt: imageAlt, image_background_color: imageBackgroundColor, data_client: dataClient, 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, urlOnLogon: urlOnLogon }));
|
|
49
|
-
}
|
|
50
|
-
export default LoginPage;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { PasswordRequirementOverrides } from "../components/layouts/shared/config/layout_customization";
|
|
2
|
-
export type RegisterPageProps = {
|
|
3
|
-
showNameField?: boolean;
|
|
4
|
-
passwordRequirements?: PasswordRequirementOverrides;
|
|
5
|
-
alreadyLoggedInMessage?: string;
|
|
6
|
-
showLogoutButton?: boolean;
|
|
7
|
-
showReturnHomeButton?: boolean;
|
|
8
|
-
returnHomeButtonLabel?: string;
|
|
9
|
-
returnHomePath?: string;
|
|
10
|
-
signInPath?: string;
|
|
11
|
-
signInLabel?: string;
|
|
12
|
-
urlOnLogon?: string;
|
|
13
|
-
imageSrc?: string;
|
|
14
|
-
imageAlt?: string;
|
|
15
|
-
imageBackgroundColor?: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Zero-config register page component
|
|
19
|
-
* Uses sensible defaults and can be customized via props
|
|
20
|
-
* @param props - Optional configuration overrides
|
|
21
|
-
* @returns Register page component
|
|
22
|
-
*/
|
|
23
|
-
export declare function RegisterPage({ showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, urlOnLogon, imageSrc, imageAlt, imageBackgroundColor, }?: RegisterPageProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export default RegisterPage;
|
|
25
|
-
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/page_components/register.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AAgB7G,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,aAAoB,EACpB,oBAAoD,EACpD,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,UAA+B,EAC/B,WAAuB,EACvB,UAAU,EACV,QAA4B,EAC5B,QAA4B,EAC5B,oBAAuC,GACxC,GAAE,iBAAsB,2CAwCxB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// file_description: zero-config register page component for hazo_auth
|
|
2
|
-
// Consumers can use this directly without needing to configure props
|
|
3
|
-
//
|
|
4
|
-
// ⚠️ DEPRECATED: This client component is deprecated in hazo_auth v2.0+
|
|
5
|
-
// Please use the new server component version instead:
|
|
6
|
-
//
|
|
7
|
-
// import { RegisterPage } from "hazo_auth/pages/register";
|
|
8
|
-
//
|
|
9
|
-
// The new version:
|
|
10
|
-
// - Initializes on the server (no loading state)
|
|
11
|
-
// - Works with your app's hazo_connect instance
|
|
12
|
-
// - True zero-config "drop in and use"
|
|
13
|
-
// - Better performance (smaller bundle)
|
|
14
|
-
//
|
|
15
|
-
// This file will be removed in v3.0
|
|
16
|
-
//
|
|
17
|
-
"use client";
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
// section: imports
|
|
20
|
-
import { useEffect, useState } from "react";
|
|
21
|
-
import register_layout from "../components/layouts/register/index.js";
|
|
22
|
-
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
|
-
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/register_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#e2e8f0";
|
|
28
|
-
const DEFAULT_PASSWORD_REQUIREMENTS = {
|
|
29
|
-
minimum_length: 8,
|
|
30
|
-
require_uppercase: true,
|
|
31
|
-
require_lowercase: true,
|
|
32
|
-
require_number: true,
|
|
33
|
-
require_special: false,
|
|
34
|
-
};
|
|
35
|
-
// section: component
|
|
36
|
-
/**
|
|
37
|
-
* Zero-config register page component
|
|
38
|
-
* Uses sensible defaults and can be customized via props
|
|
39
|
-
* @param props - Optional configuration overrides
|
|
40
|
-
* @returns Register page component
|
|
41
|
-
*/
|
|
42
|
-
export function RegisterPage({ showNameField = true, passwordRequirements = DEFAULT_PASSWORD_REQUIREMENTS, alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", signInPath = "/hazo_auth/login", signInLabel = "Sign in", urlOnLogon, imageSrc = DEFAULT_IMAGE_SRC, imageAlt = DEFAULT_IMAGE_ALT, imageBackgroundColor = DEFAULT_IMAGE_BG, } = {}) {
|
|
43
|
-
const [dataClient, setDataClient] = useState(null);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
// Initialize hazo_connect on client side
|
|
46
|
-
const hazoConnect = create_sqlite_hazo_connect();
|
|
47
|
-
const client = createLayoutDataClient(hazoConnect);
|
|
48
|
-
setDataClient(client);
|
|
49
|
-
}, []);
|
|
50
|
-
// Show loading state while initializing
|
|
51
|
-
if (!dataClient) {
|
|
52
|
-
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..." }) }));
|
|
53
|
-
}
|
|
54
|
-
const RegisterLayout = register_layout;
|
|
55
|
-
return (_jsx(RegisterLayout, { image_src: imageSrc, image_alt: imageAlt, image_background_color: imageBackgroundColor, password_requirements: passwordRequirements, show_name_field: showNameField, data_client: dataClient, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, signInPath: signInPath, signInLabel: signInLabel, urlOnLogon: urlOnLogon }));
|
|
56
|
-
}
|
|
57
|
-
export default RegisterPage;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { PasswordRequirementOverrides } from "../components/layouts/shared/config/layout_customization";
|
|
2
|
-
export type ResetPasswordPageProps = {
|
|
3
|
-
errorMessage?: string;
|
|
4
|
-
successMessage?: string;
|
|
5
|
-
loginPath?: string;
|
|
6
|
-
forgotPasswordPath?: string;
|
|
7
|
-
passwordRequirements?: PasswordRequirementOverrides;
|
|
8
|
-
alreadyLoggedInMessage?: string;
|
|
9
|
-
showLogoutButton?: boolean;
|
|
10
|
-
showReturnHomeButton?: boolean;
|
|
11
|
-
returnHomeButtonLabel?: string;
|
|
12
|
-
returnHomePath?: string;
|
|
13
|
-
imageSrc?: string;
|
|
14
|
-
imageAlt?: string;
|
|
15
|
-
imageBackgroundColor?: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Zero-config reset password page component
|
|
19
|
-
* Uses sensible defaults and can be customized via props
|
|
20
|
-
* @param props - Optional configuration overrides
|
|
21
|
-
* @returns Reset password page component
|
|
22
|
-
*/
|
|
23
|
-
export declare function ResetPasswordPage({ errorMessage, successMessage, loginPath, forgotPasswordPath, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, imageSrc, imageAlt, imageBackgroundColor, }?: ResetPasswordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export default ResetPasswordPage;
|
|
25
|
-
//# sourceMappingURL=reset_password.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reset_password.d.ts","sourceRoot":"","sources":["../../src/page_components/reset_password.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AAgB7G,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,YAAmE,EACnE,cAAwF,EACxF,SAA8B,EAC9B,kBAAiD,EACjD,oBAAoD,EACpD,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,QAA4B,EAC5B,QAA4B,EAC5B,oBAAuC,GACxC,GAAE,sBAA2B,2CAsC7B;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// file_description: zero-config reset password page component for hazo_auth
|
|
2
|
-
// Consumers can use this directly without needing to configure props
|
|
3
|
-
//
|
|
4
|
-
// ⚠️ DEPRECATED: This client component is deprecated in hazo_auth v2.0+
|
|
5
|
-
// Please use the new server component version instead:
|
|
6
|
-
//
|
|
7
|
-
// import { ResetPasswordPage } from "hazo_auth/pages/reset_password";
|
|
8
|
-
//
|
|
9
|
-
// The new version:
|
|
10
|
-
// - Initializes on the server (no loading state)
|
|
11
|
-
// - Works with your app's hazo_connect instance
|
|
12
|
-
// - True zero-config "drop in and use"
|
|
13
|
-
// - Better performance (smaller bundle)
|
|
14
|
-
//
|
|
15
|
-
// This file will be removed in v3.0
|
|
16
|
-
//
|
|
17
|
-
"use client";
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
// section: imports
|
|
20
|
-
import { useEffect, useState } from "react";
|
|
21
|
-
import reset_password_layout from "../components/layouts/reset_password/index.js";
|
|
22
|
-
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
|
-
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/reset_password_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
28
|
-
const DEFAULT_PASSWORD_REQUIREMENTS = {
|
|
29
|
-
minimum_length: 8,
|
|
30
|
-
require_uppercase: true,
|
|
31
|
-
require_lowercase: true,
|
|
32
|
-
require_number: true,
|
|
33
|
-
require_special: false,
|
|
34
|
-
};
|
|
35
|
-
// section: component
|
|
36
|
-
/**
|
|
37
|
-
* Zero-config reset password page component
|
|
38
|
-
* Uses sensible defaults and can be customized via props
|
|
39
|
-
* @param props - Optional configuration overrides
|
|
40
|
-
* @returns Reset password page component
|
|
41
|
-
*/
|
|
42
|
-
export function ResetPasswordPage({ errorMessage = "Your password reset link has expired or is invalid", successMessage = "Password reset successful! You can now log in with your new password.", loginPath = "/hazo_auth/login", forgotPasswordPath = "/hazo_auth/forgot_password", passwordRequirements = DEFAULT_PASSWORD_REQUIREMENTS, alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", imageSrc = DEFAULT_IMAGE_SRC, imageAlt = DEFAULT_IMAGE_ALT, imageBackgroundColor = DEFAULT_IMAGE_BG, } = {}) {
|
|
43
|
-
const [dataClient, setDataClient] = useState(null);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
// Initialize hazo_connect on client side
|
|
46
|
-
const hazoConnect = create_sqlite_hazo_connect();
|
|
47
|
-
const client = createLayoutDataClient(hazoConnect);
|
|
48
|
-
setDataClient(client);
|
|
49
|
-
}, []);
|
|
50
|
-
// Show loading state while initializing
|
|
51
|
-
if (!dataClient) {
|
|
52
|
-
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..." }) }));
|
|
53
|
-
}
|
|
54
|
-
const ResetPasswordLayout = reset_password_layout;
|
|
55
|
-
return (_jsx(ResetPasswordLayout, { image_src: imageSrc, image_alt: imageAlt, image_background_color: imageBackgroundColor, data_client: dataClient, errorMessage: errorMessage, successMessage: successMessage, password_requirements: passwordRequirements, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath }));
|
|
56
|
-
}
|
|
57
|
-
export default ResetPasswordPage;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type VerifyEmailPageProps = {
|
|
2
|
-
alreadyLoggedInMessage?: string;
|
|
3
|
-
showLogoutButton?: boolean;
|
|
4
|
-
showReturnHomeButton?: boolean;
|
|
5
|
-
returnHomeButtonLabel?: string;
|
|
6
|
-
returnHomePath?: string;
|
|
7
|
-
redirectDelay?: number;
|
|
8
|
-
loginPath?: string;
|
|
9
|
-
imageSrc?: string;
|
|
10
|
-
imageAlt?: string;
|
|
11
|
-
imageBackgroundColor?: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Zero-config verify email page component
|
|
15
|
-
* Uses sensible defaults and can be customized via props
|
|
16
|
-
* @param props - Optional configuration overrides
|
|
17
|
-
* @returns Verify email page component
|
|
18
|
-
*/
|
|
19
|
-
export declare function VerifyEmailPage({ alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, redirectDelay, loginPath, imageSrc, imageAlt, imageBackgroundColor, }?: VerifyEmailPageProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export default VerifyEmailPage;
|
|
21
|
-
//# sourceMappingURL=verify_email.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify_email.d.ts","sourceRoot":"","sources":["../../src/page_components/verify_email.tsx"],"names":[],"mappings":"AA+BA,MAAM,MAAM,oBAAoB,GAAG;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,aAAoB,EACpB,SAA8B,EAC9B,QAA4B,EAC5B,QAA4B,EAC5B,oBAAuC,GACxC,GAAE,oBAAyB,2CAqC3B;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// file_description: zero-config verify email page component for hazo_auth
|
|
2
|
-
// Consumers can use this directly without needing to configure props
|
|
3
|
-
//
|
|
4
|
-
// ⚠️ DEPRECATED: This client component is deprecated in hazo_auth v2.0+
|
|
5
|
-
// Please use the new server component version instead:
|
|
6
|
-
//
|
|
7
|
-
// import { VerifyEmailPage } from "hazo_auth/pages/verify_email";
|
|
8
|
-
//
|
|
9
|
-
// The new version:
|
|
10
|
-
// - Initializes on the server (no loading state)
|
|
11
|
-
// - Works with your app's hazo_connect instance
|
|
12
|
-
// - True zero-config "drop in and use"
|
|
13
|
-
// - Better performance (smaller bundle)
|
|
14
|
-
//
|
|
15
|
-
// This file will be removed in v3.0
|
|
16
|
-
//
|
|
17
|
-
"use client";
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
// section: imports
|
|
20
|
-
import { useEffect, useState } from "react";
|
|
21
|
-
import email_verification_layout from "../components/layouts/email_verification/index.js";
|
|
22
|
-
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
|
-
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/verify_email_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
28
|
-
// section: component
|
|
29
|
-
/**
|
|
30
|
-
* Zero-config verify email page component
|
|
31
|
-
* Uses sensible defaults and can be customized via props
|
|
32
|
-
* @param props - Optional configuration overrides
|
|
33
|
-
* @returns Verify email page component
|
|
34
|
-
*/
|
|
35
|
-
export function VerifyEmailPage({ alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", redirectDelay = 3000, loginPath = "/hazo_auth/login", imageSrc = DEFAULT_IMAGE_SRC, imageAlt = DEFAULT_IMAGE_ALT, imageBackgroundColor = DEFAULT_IMAGE_BG, } = {}) {
|
|
36
|
-
const [dataClient, setDataClient] = useState(null);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
// Initialize hazo_connect on client side
|
|
39
|
-
const hazoConnect = create_sqlite_hazo_connect();
|
|
40
|
-
const client = createLayoutDataClient(hazoConnect);
|
|
41
|
-
setDataClient(client);
|
|
42
|
-
}, []);
|
|
43
|
-
// Show loading state while initializing
|
|
44
|
-
if (!dataClient) {
|
|
45
|
-
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..." }) }));
|
|
46
|
-
}
|
|
47
|
-
const EmailVerificationLayout = email_verification_layout;
|
|
48
|
-
return (_jsx(EmailVerificationLayout, { image_src: imageSrc, image_alt: imageAlt, image_background_color: imageBackgroundColor, data_client: dataClient, already_logged_in_message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, redirect_delay: redirectDelay, login_path: loginPath }));
|
|
49
|
-
}
|
|
50
|
-
export default VerifyEmailPage;
|