hazo_auth 5.1.38 → 5.2.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.
Files changed (60) hide show
  1. package/README.md +10 -0
  2. package/cli-src/lib/auth/ensure_anon_id.server.ts +88 -0
  3. package/cli-src/lib/auth/index.ts +3 -0
  4. package/cli-src/lib/cookies_config.edge.ts +1 -0
  5. package/cli-src/lib/cookies_config.server.ts +1 -0
  6. package/cli-src/lib/hazo_connect_setup.server.ts +0 -8
  7. package/cli-src/lib/schema/sqlite_schema.ts +12 -6
  8. package/cli-src/lib/services/session_token_service.ts +2 -2
  9. package/cli-src/lib/ui_shell_config.server.ts +6 -2
  10. package/dist/components/layouts/login/index.d.ts +16 -3
  11. package/dist/components/layouts/login/index.d.ts.map +1 -1
  12. package/dist/components/layouts/login/index.js +49 -5
  13. package/dist/components/layouts/register/index.d.ts +7 -3
  14. package/dist/components/layouts/register/index.d.ts.map +1 -1
  15. package/dist/components/layouts/register/index.js +36 -3
  16. package/dist/components/layouts/shared/components/floating_home_link.d.ts +20 -0
  17. package/dist/components/layouts/shared/components/floating_home_link.d.ts.map +1 -0
  18. package/dist/components/layouts/shared/components/floating_home_link.js +29 -0
  19. package/dist/components/layouts/shared/components/profile_pic_menu.d.ts +8 -0
  20. package/dist/components/layouts/shared/components/profile_pic_menu.d.ts.map +1 -1
  21. package/dist/components/layouts/shared/components/profile_pic_menu.js +18 -8
  22. package/dist/components/layouts/shared/index.d.ts +2 -0
  23. package/dist/components/layouts/shared/index.d.ts.map +1 -1
  24. package/dist/components/layouts/shared/index.js +1 -0
  25. package/dist/components/ui/button.d.ts +2 -2
  26. package/dist/lib/auth/ensure_anon_id.server.d.ts +21 -0
  27. package/dist/lib/auth/ensure_anon_id.server.d.ts.map +1 -0
  28. package/dist/lib/auth/ensure_anon_id.server.js +73 -0
  29. package/dist/lib/auth/index.d.ts +1 -0
  30. package/dist/lib/auth/index.d.ts.map +1 -1
  31. package/dist/lib/auth/index.js +2 -0
  32. package/dist/lib/cookies_config.edge.d.ts +1 -0
  33. package/dist/lib/cookies_config.edge.d.ts.map +1 -1
  34. package/dist/lib/cookies_config.edge.js +1 -0
  35. package/dist/lib/cookies_config.server.d.ts +1 -0
  36. package/dist/lib/cookies_config.server.d.ts.map +1 -1
  37. package/dist/lib/cookies_config.server.js +1 -0
  38. package/dist/lib/hazo_connect_setup.server.d.ts.map +1 -1
  39. package/dist/lib/hazo_connect_setup.server.js +0 -8
  40. package/dist/lib/schema/sqlite_schema.d.ts +1 -1
  41. package/dist/lib/schema/sqlite_schema.d.ts.map +1 -1
  42. package/dist/lib/schema/sqlite_schema.js +12 -6
  43. package/dist/lib/services/session_token_service.js +2 -2
  44. package/dist/lib/ui_shell_config.server.d.ts.map +1 -1
  45. package/dist/lib/ui_shell_config.server.js +6 -2
  46. package/dist/server/routes/oauth_google_callback.d.ts.map +1 -1
  47. package/dist/server/routes/oauth_google_callback.js +33 -6
  48. package/dist/server_pages/login.d.ts +13 -1
  49. package/dist/server_pages/login.d.ts.map +1 -1
  50. package/dist/server_pages/login.js +25 -9
  51. package/dist/server_pages/login_client_wrapper.d.ts +6 -4
  52. package/dist/server_pages/login_client_wrapper.d.ts.map +1 -1
  53. package/dist/server_pages/login_client_wrapper.js +2 -2
  54. package/dist/server_pages/register.d.ts +7 -1
  55. package/dist/server_pages/register.d.ts.map +1 -1
  56. package/dist/server_pages/register.js +18 -9
  57. package/dist/server_pages/register_client_wrapper.d.ts +6 -4
  58. package/dist/server_pages/register_client_wrapper.d.ts.map +1 -1
  59. package/dist/server_pages/register_client_wrapper.js +2 -2
  60. package/package.json +40 -34
@@ -1,11 +1,13 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // file_description: Zero-config LoginPage server component - drop in and use with no configuration required
3
3
  // section: server-only-guard
4
4
  import "server-only";
5
5
  // section: imports
6
6
  import { get_login_config } from "../lib/login_config.server.js";
7
+ import { get_navbar_config } from "../lib/navbar_config.server.js";
7
8
  import { LoginClientWrapper } from "./login_client_wrapper.js";
8
9
  import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
10
+ import { FloatingHomeLink } from "../components/layouts/shared/components/floating_home_link.js";
9
11
  // section: component
10
12
  /**
11
13
  * Zero-config LoginPage server component
@@ -30,20 +32,34 @@ import { AuthPageShell } from "../components/layouts/shared/components/auth_page
30
32
  * @param props - Optional visual customization props
31
33
  * @returns Server-rendered login page
32
34
  */
33
- export default function LoginPage({ image_src, image_alt, image_background_color, } = {}) {
35
+ export default function LoginPage({ image_src, image_alt, image_background_color, layout = "two_column", } = {}) {
34
36
  // Load configuration from INI file (with defaults including asset images)
35
37
  const config = get_login_config();
36
38
  // Use props if provided, otherwise fall back to config (which includes default asset image)
37
39
  const finalImageSrc = image_src || config.imageSrc;
38
40
  const finalImageAlt = image_alt || config.imageAlt;
39
41
  const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
40
- // Pass serializable config to client wrapper, wrapped in AuthPageShell for navbar support
41
- return (_jsx(AuthPageShell, { children: _jsx(LoginClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, redirectRoute: config.redirectRoute, successMessage: config.successMessage, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath, forgotPasswordPath: config.forgotPasswordPath, forgotPasswordLabel: config.forgotPasswordLabel, createAccountPath: config.createAccountPath, createAccountLabel: config.createAccountLabel, showCreateAccountLink: config.showCreateAccountLink, oauth: {
42
- enable_google: config.oauth.enable_google,
43
- enable_email_password: config.oauth.enable_email_password,
44
- google_button_text: config.oauth.google_button_text,
45
- oauth_divider_text: config.oauth.oauth_divider_text,
46
- } }) }));
42
+ const wrapper = (_jsx(LoginClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, redirectRoute: config.redirectRoute, successMessage: config.successMessage, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath, forgotPasswordPath: config.forgotPasswordPath, forgotPasswordLabel: config.forgotPasswordLabel, createAccountPath: config.createAccountPath, createAccountLabel: config.createAccountLabel, showCreateAccountLink: config.showCreateAccountLink, oauth: {
43
+ enable_google: config.oauth.enable_google,
44
+ enable_email_password: config.oauth.enable_email_password,
45
+ google_button_text: config.oauth.google_button_text,
46
+ oauth_divider_text: config.oauth.oauth_divider_text,
47
+ }, layout: layout }));
48
+ // form_only mode: skip AuthPageShell so the consumer's own page chrome
49
+ // (e.g. a split-panel AuthLayout) hosts the form without our standalone
50
+ // wrapper interfering. Two-column mode keeps the existing AuthPageShell
51
+ // wrap for navbar/centering support.
52
+ //
53
+ // The navbar config's home_link is also surfaced here in form_only mode
54
+ // so users mid-auth-flow always have a way out — without this, the only
55
+ // exit is the browser back button. Rendered as a fixed-position "Back to
56
+ // home" pill (top-left). Disabled by setting `[hazo_auth__navbar]
57
+ // show_home_link = false` or by hiding it CSS-side at the consumer.
58
+ if (layout === "form_only") {
59
+ const navbar = get_navbar_config();
60
+ return (_jsxs(_Fragment, { children: [navbar.show_home_link && (_jsx(FloatingHomeLink, { path: navbar.home_path, label: navbar.home_label })), wrapper] }));
61
+ }
62
+ return _jsx(AuthPageShell, { children: wrapper });
47
63
  }
48
64
  // Named export for direct imports
49
65
  export { LoginPage };
@@ -2,17 +2,19 @@ import type { LoginConfig } from "../lib/login_config.server";
2
2
  import type { OAuthLayoutConfig } from "../components/layouts/login/index";
3
3
  import type { StaticImageData } from "next/image";
4
4
  export type LoginClientWrapperProps = Omit<LoginConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor' | 'oauth' | 'showCreateAccountLink'> & {
5
- image_src: string | StaticImageData;
6
- image_alt: string;
7
- image_background_color: string;
5
+ image_src?: string | StaticImageData;
6
+ image_alt?: string;
7
+ image_background_color?: string;
8
8
  /** Show/hide "Create account" link (default: true) */
9
9
  showCreateAccountLink?: boolean;
10
10
  /** OAuth configuration */
11
11
  oauth?: OAuthLayoutConfig;
12
+ /** Layout mode — see LoginLayoutProps.layout. Default `"two_column"`. */
13
+ layout?: "two_column" | "form_only";
12
14
  };
13
15
  /**
14
16
  * Client wrapper for LoginLayout
15
17
  * Initializes hazo_connect data client on client side and passes config from server
16
18
  */
17
- export declare function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink, oauth, }: LoginClientWrapperProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink, oauth, layout, }: LoginClientWrapperProps): import("react/jsx-runtime").JSX.Element;
18
20
  //# sourceMappingURL=login_client_wrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"login_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/login_client_wrapper.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,GAAG,OAAO,GAAG,uBAAuB,CAAC,GAAG;IAC9I,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,sDAAsD;IACtD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAGF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,qBAA4B,EAC5B,KAAK,GACN,EAAE,uBAAuB,2CAyCzB"}
1
+ {"version":3,"file":"login_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/login_client_wrapper.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,GAAG,OAAO,GAAG,uBAAuB,CAAC,GAAG;IAC9I,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sDAAsD;IACtD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,yEAAyE;IACzE,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrC,CAAC;AAGF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,qBAA4B,EAC5B,KAAK,EACL,MAAqB,GACtB,EAAE,uBAAuB,2CA0CzB"}
@@ -11,7 +11,7 @@ import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
11
11
  * Client wrapper for LoginLayout
12
12
  * Initializes hazo_connect data client on client side and passes config from server
13
13
  */
14
- export function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink = true, oauth, }) {
14
+ export function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink = true, oauth, layout = "two_column", }) {
15
15
  const [dataClient, setDataClient] = useState(null);
16
16
  useEffect(() => {
17
17
  // Initialize hazo_connect on client side
@@ -23,5 +23,5 @@ export function LoginClientWrapper({ image_src, image_alt, image_background_colo
23
23
  if (!dataClient) {
24
24
  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..." }) }));
25
25
  }
26
- return (_jsx(LoginLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, 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, show_create_account_link: showCreateAccountLink, oauth: oauth }));
26
+ return (_jsx(LoginLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, 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, show_create_account_link: showCreateAccountLink, oauth: oauth, layout: layout }));
27
27
  }
@@ -16,6 +16,12 @@ export type RegisterPageProps = {
16
16
  * Defaults from hazo_auth_config.ini or "#e2e8f0"
17
17
  */
18
18
  image_background_color?: string;
19
+ /**
20
+ * Layout mode (default: `"two_column"`). See `LoginPageProps.layout` for the
21
+ * full description. `"form_only"` skips both AuthPageShell and
22
+ * TwoColumnAuthLayout so the consumer's brand chrome can wrap the form.
23
+ */
24
+ layout?: "two_column" | "form_only";
19
25
  };
20
26
  /**
21
27
  * Zero-config RegisterPage server component
@@ -42,6 +48,6 @@ export type RegisterPageProps = {
42
48
  * @param props - Optional visual customization props
43
49
  * @returns Server-rendered register page
44
50
  */
45
- export default function RegisterPage({ image_src, image_alt, image_background_color, }?: RegisterPageProps): import("react/jsx-runtime").JSX.Element;
51
+ export default function RegisterPage({ image_src, image_alt, image_background_color, layout, }?: RegisterPageProps): import("react/jsx-runtime").JSX.Element;
46
52
  export { RegisterPage };
47
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;AAOrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAS,EACT,SAAS,EACT,sBAAsB,GACvB,GAAE,iBAAsB,2CAkCxB;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/server_pages/register.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB,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,2CAiDxB;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,11 +1,13 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // file_description: Zero-config RegisterPage server component - drop in and use with no configuration required
3
3
  // section: server-only-guard
4
4
  import "server-only";
5
5
  // section: imports
6
6
  import { get_register_config } from "../lib/register_config.server.js";
7
+ import { get_navbar_config } from "../lib/navbar_config.server.js";
7
8
  import { RegisterClientWrapper } from "./register_client_wrapper.js";
8
9
  import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
10
+ import { FloatingHomeLink } from "../components/layouts/shared/components/floating_home_link.js";
9
11
  // section: component
10
12
  /**
11
13
  * Zero-config RegisterPage server component
@@ -32,20 +34,27 @@ import { AuthPageShell } from "../components/layouts/shared/components/auth_page
32
34
  * @param props - Optional visual customization props
33
35
  * @returns Server-rendered register page
34
36
  */
35
- export default function RegisterPage({ image_src, image_alt, image_background_color, } = {}) {
37
+ export default function RegisterPage({ image_src, image_alt, image_background_color, layout = "two_column", } = {}) {
36
38
  // Load configuration from INI file (with defaults including asset images)
37
39
  const config = get_register_config();
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
- // Pass serializable config to client wrapper, wrapped in AuthPageShell for navbar support
43
- return (_jsx(AuthPageShell, { children: _jsx(RegisterClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, showNameField: config.showNameField, passwordRequirements: config.passwordRequirements, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath, signInPath: config.signInPath, signInLabel: config.signInLabel, oauth: {
44
- enable_google: config.oauth.enable_google,
45
- enable_email_password: config.oauth.enable_email_password,
46
- google_button_text: config.oauth.google_button_text,
47
- oauth_divider_text: config.oauth.oauth_divider_text,
48
- } }) }));
44
+ const wrapper = (_jsx(RegisterClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, showNameField: config.showNameField, passwordRequirements: config.passwordRequirements, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath, signInPath: config.signInPath, signInLabel: config.signInLabel, oauth: {
45
+ enable_google: config.oauth.enable_google,
46
+ enable_email_password: config.oauth.enable_email_password,
47
+ google_button_text: config.oauth.google_button_text,
48
+ oauth_divider_text: config.oauth.oauth_divider_text,
49
+ }, layout: layout }));
50
+ // form_only mode: skip AuthPageShell so the consumer's own page chrome
51
+ // hosts the form. See LoginPage for the full rationale, including the
52
+ // FloatingHomeLink rendering rule below.
53
+ if (layout === "form_only") {
54
+ const navbar = get_navbar_config();
55
+ return (_jsxs(_Fragment, { children: [navbar.show_home_link && (_jsx(FloatingHomeLink, { path: navbar.home_path, label: navbar.home_label })), wrapper] }));
56
+ }
57
+ return _jsx(AuthPageShell, { children: wrapper });
49
58
  }
50
59
  // Named export for direct imports
51
60
  export { RegisterPage };
@@ -2,15 +2,17 @@ import type { RegisterConfig } from "../lib/register_config.server";
2
2
  import type { OAuthLayoutConfig } from "../components/layouts/register/index";
3
3
  import type { StaticImageData } from "next/image";
4
4
  export type RegisterClientWrapperProps = Omit<RegisterConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor' | 'oauth'> & {
5
- image_src: string | StaticImageData;
6
- image_alt: string;
7
- image_background_color: string;
5
+ image_src?: string | StaticImageData;
6
+ image_alt?: string;
7
+ image_background_color?: string;
8
8
  /** OAuth configuration */
9
9
  oauth?: OAuthLayoutConfig;
10
+ /** Layout mode — see RegisterLayoutProps.layout. Default `"two_column"`. */
11
+ layout?: "two_column" | "form_only";
10
12
  };
11
13
  /**
12
14
  * Client wrapper for RegisterLayout
13
15
  * Initializes hazo_connect data client on client side and passes config from server
14
16
  */
15
- export declare function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, }: RegisterClientWrapperProps): import("react/jsx-runtime").JSX.Element;
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;
16
18
  //# 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;AAG9E,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,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B,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,GACN,EAAE,0BAA0B,2CAsC5B"}
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;AAG9E,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;CACrC,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,GACtB,EAAE,0BAA0B,2CAuC5B"}
@@ -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, }) {
14
+ export function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, layout = "two_column", }) {
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 }));
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 }));
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_auth",
3
- "version": "5.1.38",
3
+ "version": "5.2.0",
4
4
  "description": "Zero-config authentication UI components for Next.js with RBAC, OAuth, scope-based multi-tenancy, and invitations",
5
5
  "keywords": [
6
6
  "authentication",
@@ -89,6 +89,10 @@
89
89
  "types": "./dist/lib/auth/hazo_get_auth.server.d.ts",
90
90
  "import": "./dist/lib/auth/hazo_get_auth.server.js"
91
91
  },
92
+ "./lib/auth/ensure_anon_id.server": {
93
+ "types": "./dist/lib/auth/ensure_anon_id.server.d.ts",
94
+ "import": "./dist/lib/auth/ensure_anon_id.server.js"
95
+ },
92
96
  "./server": {
93
97
  "types": "./dist/server/index.d.ts",
94
98
  "import": "./dist/server/index.js"
@@ -214,8 +218,8 @@
214
218
  "jsonwebtoken": "^9.0.2",
215
219
  "mime-types": "^3.0.1",
216
220
  "server-only": "^0.0.1",
217
- "tailwind-merge": "^3.4.0",
218
- "tailwindcss-animate": "^1.0.7",
221
+ "tailwind-merge": "^3.5.0",
222
+ "tw-animate-css": "^1.4.0",
219
223
  "zod": "^4.1.12"
220
224
  },
221
225
  "optionalDependencies": {
@@ -230,17 +234,6 @@
230
234
  "multer": "^2.0.2"
231
235
  },
232
236
  "peerDependencies": {
233
- "hazo_config": "^1.4.0 || ^2.0.0",
234
- "hazo_connect": "^2.4.0",
235
- "hazo_logs": "^1.0.10",
236
- "hazo_notify": "^1.0.0",
237
- "hazo_ui": "^2.0.0",
238
- "next": ">=14.0.0",
239
- "next-auth": "^4.24.0",
240
- "next-themes": "^0.4.0",
241
- "react": "^18.0.0 || ^19.0.0",
242
- "react-dom": "^18.0.0 || ^19.0.0",
243
- "sonner": "^2.0.0",
244
237
  "@radix-ui/react-accordion": "^1.2.0",
245
238
  "@radix-ui/react-alert-dialog": "^1.1.0",
246
239
  "@radix-ui/react-avatar": "^1.1.0",
@@ -255,7 +248,18 @@
255
248
  "@radix-ui/react-switch": "^1.2.0",
256
249
  "@radix-ui/react-tabs": "^1.1.0",
257
250
  "@radix-ui/react-tooltip": "^1.2.0",
258
- "lucide-react": ">=0.400.0"
251
+ "hazo_config": "^2.1.0",
252
+ "hazo_connect": "^2.4.0",
253
+ "hazo_logs": "^1.0.13",
254
+ "hazo_notify": "^1.1.0",
255
+ "hazo_ui": "^2.7.0",
256
+ "lucide-react": "^0.553.0",
257
+ "next": ">=14.0.0",
258
+ "next-auth": "^4.24.0",
259
+ "next-themes": "^0.4.0",
260
+ "react": "^18.0.0 || ^19.0.0",
261
+ "react-dom": "^18.0.0 || ^19.0.0",
262
+ "sonner": "^2.0.7"
259
263
  },
260
264
  "peerDependenciesMeta": {
261
265
  "hazo_config": {
@@ -326,18 +330,7 @@
326
330
  }
327
331
  },
328
332
  "devDependencies": {
329
- "hazo_config": "^1.4.2",
330
- "hazo_connect": "^2.4.2",
331
- "hazo_logs": "^1.0.10",
332
- "hazo_notify": "^1.0.0",
333
- "hazo_ui": "^2.0.0",
334
- "next": "^16.0.7",
335
- "next-auth": "^4.24.13",
336
- "next-themes": "^0.4.6",
337
- "react": "^18.3.1",
338
- "react-dom": "^18.3.1",
339
- "sonner": "^2.0.7",
340
- "lucide-react": "^0.553.0",
333
+ "@chromatic-com/storybook": "^4.1.2",
341
334
  "@radix-ui/react-accordion": "^1.2.12",
342
335
  "@radix-ui/react-alert-dialog": "^1.1.15",
343
336
  "@radix-ui/react-avatar": "^1.1.11",
@@ -352,7 +345,6 @@
352
345
  "@radix-ui/react-switch": "^1.2.6",
353
346
  "@radix-ui/react-tabs": "^1.1.13",
354
347
  "@radix-ui/react-tooltip": "^1.2.8",
355
- "@chromatic-com/storybook": "^4.1.2",
356
348
  "@storybook/addon-a11y": "^10.0.6",
357
349
  "@storybook/addon-docs": "^10.0.6",
358
350
  "@storybook/addon-onboarding": "^10.0.6",
@@ -371,23 +363,37 @@
371
363
  "@types/jsonwebtoken": "^9.0.10",
372
364
  "@types/multer": "^2.0.0",
373
365
  "@types/node": "^20.19.24",
374
- "@types/react": "^18",
375
- "@types/react-dom": "^18",
366
+ "@types/react": "^18.3.3",
367
+ "@types/react-dom": "^18.3.0",
376
368
  "better-sqlite3": "^12.4.1",
377
369
  "cross-env": "^10.1.0",
370
+ "dotenv": "^17.4.2",
378
371
  "eslint": "^9.39.1",
379
372
  "eslint-config-next": "^16.0.4",
380
373
  "eslint-plugin-storybook": "^10.0.6",
374
+ "@tailwindcss/postcss": "^4.2.4",
375
+ "hazo_config": "^2.1.0",
376
+ "hazo_connect": "^2.4.0",
377
+ "hazo_logs": "^1.0.13",
378
+ "hazo_notify": "^1.1.0",
379
+ "hazo_ui": "^2.7.0",
381
380
  "jest": "^30.2.0",
382
- "jest-environment-jsdom": "^29.7.0",
381
+ "jest-environment-jsdom": "^30.0.0",
382
+ "lucide-react": "^0.553.0",
383
+ "next": "^16.0.7",
384
+ "next-auth": "^4.24.13",
385
+ "next-themes": "^0.4.6",
383
386
  "patch-package": "^8.0.1",
384
387
  "playwright": "^1.57.0",
385
- "postcss": "^8",
388
+ "postcss": "^8.4.49",
389
+ "react": "^18.3.1",
390
+ "react-dom": "^18.3.1",
391
+ "sonner": "^2.0.7",
386
392
  "storybook": "^10.0.6",
387
393
  "supertest": "^7.1.4",
388
- "tailwindcss": "^3.4.1",
394
+ "tailwindcss": "^4.2.4",
389
395
  "ts-jest": "^29.4.5",
390
396
  "tsx": "^4.20.6",
391
- "typescript": "^5"
397
+ "typescript": "^5.7.2"
392
398
  }
393
399
  }