hazo_auth 10.24.0 → 10.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/cli-src/lib/already_logged_in_config.server.ts +13 -0
  2. package/cli-src/lib/auth/auth_types.ts +6 -0
  3. package/cli-src/lib/auth/hazo_get_auth.server.ts +3 -0
  4. package/cli-src/lib/location_fields_config.server.ts +42 -0
  5. package/cli-src/lib/login_config.server.ts +3 -0
  6. package/cli-src/lib/my_settings_config.server.ts +6 -0
  7. package/cli-src/lib/register_config.server.ts +16 -0
  8. package/cli-src/lib/services/location_fields_helper.ts +30 -0
  9. package/cli-src/lib/services/registration_service.ts +21 -0
  10. package/cli-src/lib/services/user_update_service.ts +7 -0
  11. package/dist/components/layouts/legal/legal_acceptance_gate.d.ts +1 -1
  12. package/dist/components/layouts/legal/legal_acceptance_gate.d.ts.map +1 -1
  13. package/dist/components/layouts/legal/legal_acceptance_gate.js +5 -3
  14. package/dist/components/layouts/login/index.d.ts +8 -1
  15. package/dist/components/layouts/login/index.d.ts.map +1 -1
  16. package/dist/components/layouts/login/index.js +2 -2
  17. package/dist/components/layouts/my_settings/hooks/use_my_settings.d.ts +8 -0
  18. package/dist/components/layouts/my_settings/hooks/use_my_settings.d.ts.map +1 -1
  19. package/dist/components/layouts/my_settings/hooks/use_my_settings.js +37 -0
  20. package/dist/components/layouts/my_settings/index.d.ts +6 -1
  21. package/dist/components/layouts/my_settings/index.d.ts.map +1 -1
  22. package/dist/components/layouts/my_settings/index.js +3 -3
  23. package/dist/components/layouts/register/hooks/use_register_form.d.ts +15 -1
  24. package/dist/components/layouts/register/hooks/use_register_form.d.ts.map +1 -1
  25. package/dist/components/layouts/register/hooks/use_register_form.js +69 -4
  26. package/dist/components/layouts/register/index.d.ts +7 -1
  27. package/dist/components/layouts/register/index.d.ts.map +1 -1
  28. package/dist/components/layouts/register/index.js +30 -4
  29. package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts +8 -1
  30. package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts.map +1 -1
  31. package/dist/components/layouts/shared/components/already_logged_in_guard.js +15 -1
  32. package/dist/components/layouts/shared/hooks/use_auth_status.d.ts +3 -0
  33. package/dist/components/layouts/shared/hooks/use_auth_status.d.ts.map +1 -1
  34. package/dist/components/layouts/shared/hooks/use_auth_status.js +5 -2
  35. package/dist/components/ui/button.d.ts +1 -1
  36. package/dist/lib/already_logged_in_config.server.d.ts +8 -0
  37. package/dist/lib/already_logged_in_config.server.d.ts.map +1 -1
  38. package/dist/lib/already_logged_in_config.server.js +4 -0
  39. package/dist/lib/auth/auth_types.d.ts +3 -0
  40. package/dist/lib/auth/auth_types.d.ts.map +1 -1
  41. package/dist/lib/auth/hazo_get_auth.server.d.ts.map +1 -1
  42. package/dist/lib/auth/hazo_get_auth.server.js +3 -0
  43. package/dist/lib/location_fields_config.server.d.ts +22 -0
  44. package/dist/lib/location_fields_config.server.d.ts.map +1 -0
  45. package/dist/lib/location_fields_config.server.js +31 -0
  46. package/dist/lib/login_config.server.d.ts +2 -0
  47. package/dist/lib/login_config.server.d.ts.map +1 -1
  48. package/dist/lib/login_config.server.js +1 -0
  49. package/dist/lib/my_settings_config.server.d.ts +4 -0
  50. package/dist/lib/my_settings_config.server.d.ts.map +1 -1
  51. package/dist/lib/my_settings_config.server.js +3 -0
  52. package/dist/lib/register_config.server.d.ts +10 -0
  53. package/dist/lib/register_config.server.d.ts.map +1 -1
  54. package/dist/lib/register_config.server.js +7 -0
  55. package/dist/lib/services/location_fields_helper.d.ts +13 -0
  56. package/dist/lib/services/location_fields_helper.d.ts.map +1 -0
  57. package/dist/lib/services/location_fields_helper.js +24 -0
  58. package/dist/lib/services/registration_service.d.ts +9 -0
  59. package/dist/lib/services/registration_service.d.ts.map +1 -1
  60. package/dist/lib/services/registration_service.js +11 -0
  61. package/dist/lib/services/user_update_service.d.ts +5 -0
  62. package/dist/lib/services/user_update_service.d.ts.map +1 -1
  63. package/dist/lib/services/user_update_service.js +2 -0
  64. package/dist/locales/en.json +9 -0
  65. package/dist/page_components/my_settings.d.ts +9 -1
  66. package/dist/page_components/my_settings.d.ts.map +1 -1
  67. package/dist/page_components/my_settings.js +8 -2
  68. package/dist/server/routes/me.d.ts.map +1 -1
  69. package/dist/server/routes/me.js +5 -1
  70. package/dist/server/routes/register.d.ts.map +1 -1
  71. package/dist/server/routes/register.js +46 -0
  72. package/dist/server/routes/update_user.d.ts.map +1 -1
  73. package/dist/server/routes/update_user.js +24 -1
  74. package/dist/server_pages/login.d.ts.map +1 -1
  75. package/dist/server_pages/login.js +1 -1
  76. package/dist/server_pages/login_client_wrapper.d.ts +1 -1
  77. package/dist/server_pages/login_client_wrapper.d.ts.map +1 -1
  78. package/dist/server_pages/login_client_wrapper.js +2 -2
  79. package/dist/server_pages/my_settings.d.ts.map +1 -1
  80. package/dist/server_pages/my_settings.js +1 -1
  81. package/dist/server_pages/register.d.ts.map +1 -1
  82. package/dist/server_pages/register.js +1 -1
  83. package/dist/server_pages/register_client_wrapper.d.ts +4 -2
  84. package/dist/server_pages/register_client_wrapper.d.ts.map +1 -1
  85. package/dist/server_pages/register_client_wrapper.js +2 -2
  86. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"my_settings_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/my_settings_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAYrB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE;QACV,eAAe,EAAE,OAAO,CAAC;QACzB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,oBAAoB,EAAE;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,OAAO,CAAC;QAC3B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC;KAC1B,C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,0BAA0B,EAAE,MAAM,CAAC;QACnC,0BAA0B,EAAE,MAAM,CAAC;QACnC,+BAA+B,EAAE,MAAM,CAAC;QACxC,4BAA4B,EAAE,MAAM,CAAC;KACtC,CAAC;IACF,SAAS,EAAE;QACT,wBAAwB,EAAE,MAAM,EAAE,CAAC;QACnC,wBAAwB,EAAE,MAAM,EAAE,CAAC;KACpC,CAAC;CACH,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,CAkEzD"}
1
+ {"version":3,"file":"my_settings_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/my_settings_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAUrB,OAAO,EAA8B,KAAK,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGxG,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE;QACV,eAAe,EAAE,OAAO,CAAC;QACzB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF;kEAC8D;IAC9D,cAAc,EAAE,oBAAoB,CAAC;IACrC,oBAAoB,EAAE;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,OAAO,CAAC;QAC3B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,cAAc,EAAE;QACd,kBAAkB,EAAE,OAAO,CAAC;QAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,4BAA4B,EAAE,UAAU,GAAG,SAAS,CAAC;QACrD,4BAA4B,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;QACtD,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC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"./profile_picture_config.server.js";
9
9
  import { get_messages_config } from "./messages_config.server.js";
10
10
  import { get_ui_sizes_config } from "./ui_sizes_config.server.js";
11
11
  import { get_file_types_config } from "./file_types_config.server.js";
12
+ import { get_location_fields_config } from "./location_fields_config.server.js";
12
13
  // section: helpers
13
14
  /**
14
15
  * Reads my settings layout configuration from hazo_auth_config.ini file
@@ -51,8 +52,10 @@ export function get_my_settings_config() {
51
52
  const loginButtonLabel = get_config_value_optional(section, "login_button_label");
52
53
  const loginPath = get_config_value(section, "login_path", "/hazo_auth/login");
53
54
  const enableAccountDeletion = get_config_boolean(section, "enable_account_deletion", false);
55
+ const locationFields = get_location_fields_config();
54
56
  return {
55
57
  userFields,
58
+ locationFields,
56
59
  passwordRequirements,
57
60
  profilePicture,
58
61
  heading,
@@ -1,4 +1,6 @@
1
1
  import "server-only";
2
+ import { type LocationFieldsConfig } from "./location_fields_config.server.js";
3
+ import { type AppUserDataSchema } from "./app_user_data_config.server.js";
2
4
  export type RegisterConfig = {
3
5
  showNameField: boolean;
4
6
  passwordRequirements: {
@@ -28,6 +30,14 @@ export type RegisterConfig = {
28
30
  enable_facebook_oauth: boolean;
29
31
  facebook_button_text: string | undefined;
30
32
  };
33
+ /** Which indexed location fields to render on the registration form — see
34
+ * [hazo_auth__custom_fields] in hazo_auth_config.ini. */
35
+ locationFields: LocationFieldsConfig;
36
+ /** Arbitrary custom fields to render on the registration form, reusing the
37
+ * EXISTING [hazo_auth__app_user_data] JSON Schema config (ticket 09 does NOT
38
+ * introduce a second, parallel custom-field config format). Null when
39
+ * schema-based app_user_data editing isn't enabled. */
40
+ customFieldsSchema: AppUserDataSchema | null;
31
41
  };
32
42
  /**
33
43
  * Reads register layout configuration from hazo_auth_config.ini file
@@ -1 +1 @@
1
- {"version":3,"file":"register_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/register_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAoBrB,MAAM,MAAM,cAAc,GAAG;IAC3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AoB,EAAE;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,OAAO,CAAC;QAC3B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,kGAAkG;IAClG,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,0BAA0B;IAC1B,KAAK,EAAE;QACL,aAAa,EAAE,OAAO,CAAC;QACvB,qBAAqB,EAAE,OAAO,CAAC;QAC/B,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;QACvC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;QACvC,qBAAqB,EAAE,OAAO,CAAC;QAC/B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1C,CAAC;IACF;8DAC0D;IAC1D,cAAc,EAAE,oBAAoB,CAAC;IACrC;;;4DAGwD;IACxD,kBAAkB,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC9C,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,CAqFpD"}
@@ -7,6 +7,8 @@ import { get_password_requirements_config } from "./password_requirements_config
7
7
  import { get_already_logged_in_config } from "./already_logged_in_config.server.js";
8
8
  import { get_user_fields_config } from "./user_fields_config.server.js";
9
9
  import { get_oauth_config } from "./oauth_config.server.js";
10
+ import { get_location_fields_config } from "./location_fields_config.server.js";
11
+ import { get_app_user_data_schema } from "./app_user_data_config.server.js";
10
12
  // Default image path - consuming apps should either:
11
13
  // 1. Configure their own image_src in hazo_auth_config.ini
12
14
  // 2. Copy the default images from node_modules/hazo_auth/public/hazo_auth/images/ to their public folder
@@ -42,6 +44,9 @@ export function get_register_config() {
42
44
  const imageBackgroundColor = get_config_value("hazo_auth__register_layout", "image_background_color", "#e2e8f0");
43
45
  // Get OAuth configuration (shared with login)
44
46
  const oauthConfig = get_oauth_config();
47
+ // Location + arbitrary custom fields (ticket 09)
48
+ const locationFields = get_location_fields_config();
49
+ const customFieldsSchema = get_app_user_data_schema();
45
50
  // For the register page, the Google button text is undefined unless the
46
51
  // consumer explicitly overrides it — RegisterLayout falls back to
47
52
  // `t("register.oauth.google_button_default")` ("Sign up with Google").
@@ -67,5 +72,7 @@ export function get_register_config() {
67
72
  enable_facebook_oauth: oauthConfig.enable_facebook_oauth,
68
73
  facebook_button_text: oauthConfig.facebook_button_text,
69
74
  },
75
+ locationFields,
76
+ customFieldsSchema,
70
77
  };
71
78
  }
@@ -0,0 +1,13 @@
1
+ export type LocationFieldsInput = {
2
+ country?: string;
3
+ state_province?: string;
4
+ suburb?: string;
5
+ };
6
+ /**
7
+ * Returns only the location fields that were actually provided and non-blank,
8
+ * trimmed — ready to spread straight into an `insert`/`updateById` data object.
9
+ * @param location - Raw location input (e.g. from a registration or settings PATCH body)
10
+ * @returns A sparse object with only the fields worth persisting
11
+ */
12
+ export declare function build_location_fields(location: LocationFieldsInput | undefined): Record<string, string>;
13
+ //# sourceMappingURL=location_fields_helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location_fields_helper.d.ts","sourceRoot":"","sources":["../../../src/lib/services/location_fields_helper.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWvG"}
@@ -0,0 +1,24 @@
1
+ // file_description: pure helper shared by registration_service and user_update_service —
2
+ // picks and trims the three indexed location columns (country / state_province / suburb)
3
+ // from caller-supplied data, dropping anything undefined or blank after trimming.
4
+ // section: helpers
5
+ /**
6
+ * Returns only the location fields that were actually provided and non-blank,
7
+ * trimmed — ready to spread straight into an `insert`/`updateById` data object.
8
+ * @param location - Raw location input (e.g. from a registration or settings PATCH body)
9
+ * @returns A sparse object with only the fields worth persisting
10
+ */
11
+ export function build_location_fields(location) {
12
+ if (!location)
13
+ return {};
14
+ const result = {};
15
+ for (const key of ["country", "state_province", "suburb"]) {
16
+ const value = location[key];
17
+ if (value === undefined)
18
+ continue;
19
+ const trimmed = value.trim();
20
+ if (trimmed)
21
+ result[key] = trimmed;
22
+ }
23
+ return result;
24
+ }
@@ -1,4 +1,5 @@
1
1
  import type { HazoConnectAdapter } from "hazo_connect";
2
+ import { type LocationFieldsInput } from "./location_fields_helper.js";
2
3
  export type RegistrationData = {
3
4
  email: string;
4
5
  password: string;
@@ -9,6 +10,14 @@ export type RegistrationData = {
9
10
  }>;
10
11
  ip?: string | null;
11
12
  user_agent?: string | null;
13
+ /** Indexed location columns — only persisted for fields enabled via
14
+ * `[hazo_auth__custom_fields]` (the route handler is responsible for
15
+ * stripping anything not enabled before calling here; see register.ts). */
16
+ location?: LocationFieldsInput;
17
+ /** Arbitrary custom fields (ticket 09's `custom_field_*` config), merged into the
18
+ * existing `app_user_data` JSONB column via `update_app_user_data()` — no new
19
+ * column or config parser for these; see register_config.server.ts. */
20
+ custom_fields?: Record<string, unknown>;
12
21
  };
13
22
  export type RegistrationResult = {
14
23
  success: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"registration_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/registration_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAoBvD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,kBAAkB,CAAC,CA0K7B"}
1
+ {"version":3,"file":"registration_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/registration_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAkBvD,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAI3F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;gFAE4E;IAC5E,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B;;4EAEwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAqL7B"}
@@ -12,6 +12,8 @@ import { get_line_number } from "../utils/api_route_helpers.js";
12
12
  import { is_user_types_enabled, get_default_user_type, } from "../user_types_config.server.js";
13
13
  import { write_legal_acceptance } from "../legal/legal_docs_service.js";
14
14
  import { fire_auth_hook } from "../auth_hooks.js";
15
+ import { build_location_fields } from "./location_fields_helper.js";
16
+ import { update_app_user_data } from "./app_user_data_service.js";
15
17
  // section: helpers
16
18
  /**
17
19
  * Registers a new user in the database using hazo_connect
@@ -63,6 +65,9 @@ export async function register_user(adapter, data) {
63
65
  insert_data.url_on_logon = url_on_logon;
64
66
  }
65
67
  }
68
+ // Indexed location columns (country / state_province / suburb) — additive,
69
+ // no-op when `data.location` is omitted (every pre-ticket-09 caller).
70
+ Object.assign(insert_data, build_location_fields(data.location));
66
71
  // Set default profile picture if enabled
67
72
  const profile_picture_config = get_profile_picture_config();
68
73
  if (profile_picture_config.user_photo_default) {
@@ -88,6 +93,12 @@ export async function register_user(adapter, data) {
88
93
  error: "Failed to create user account",
89
94
  };
90
95
  }
96
+ // Arbitrary custom fields (JSON Schema-driven, [hazo_auth__app_user_data]) —
97
+ // merge mode is a no-op concern here (brand new user, nothing to merge over),
98
+ // kept consistent with update_app_user_data()'s only mode of operation elsewhere.
99
+ if (data.custom_fields && Object.keys(data.custom_fields).length > 0) {
100
+ await update_app_user_data(adapter, user_id, data.custom_fields, { merge: true });
101
+ }
91
102
  void fire_auth_hook("on_user_created", {
92
103
  user_id,
93
104
  email,
@@ -1,11 +1,16 @@
1
1
  import type { HazoConnectAdapter } from "hazo_connect";
2
2
  import { type ProfilePictureSourceUI } from "./profile_picture_source_mapper.js";
3
+ import { type LocationFieldsInput } from "./location_fields_helper.js";
3
4
  export type UserUpdateData = {
4
5
  name?: string;
5
6
  email?: string;
6
7
  profile_picture_url?: string;
7
8
  profile_source?: ProfilePictureSourceUI;
8
9
  preferred_locale?: string | null;
10
+ /** Indexed location columns (My Settings' "Location" card). Only non-blank,
11
+ * provided fields are persisted — omitted or blank fields are left unchanged
12
+ * (see build_location_fields; it has no "clear" semantics). */
13
+ location?: LocationFieldsInput;
9
14
  };
10
15
  export type UserUpdateResult = {
11
16
  success: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"user_update_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/user_update_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAMnG,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,sBAAsB,CAAC;IAIxC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,gBAAgB,CAAC,CA4G3B"}
1
+ {"version":3,"file":"user_update_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/user_update_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAInG,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG3F,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,sBAAsB,CAAC;IAIxC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;oEAEgE;IAChE,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,gBAAgB,CAAC,CA8G3B"}
@@ -3,6 +3,7 @@ import { map_ui_source_to_db } from "./profile_picture_source_mapper.js";
3
3
  import { create_app_logger } from "../app_logger.js";
4
4
  import { sanitize_error_for_user } from "../utils/error_sanitizer.js";
5
5
  import { get_line_number } from "../utils/api_route_helpers.js";
6
+ import { build_location_fields } from "./location_fields_helper.js";
6
7
  // section: helpers
7
8
  /**
8
9
  * Updates user profile information (name, email)
@@ -75,6 +76,7 @@ export async function update_user_profile(adapter, user_id, data) {
75
76
  // null explicitly clears the preference (falls back to detection elsewhere)
76
77
  update_data.preferred_locale = data.preferred_locale;
77
78
  }
79
+ Object.assign(update_data, build_location_fields(data.location));
78
80
  // If email changed, set email_verified to false
79
81
  if (email_changed) {
80
82
  update_data.email_verified = false;
@@ -162,6 +162,9 @@
162
162
  "register.field.name.label": "Full name",
163
163
  "register.field.name.placeholder": "Enter your full name",
164
164
  "register.field.name.aria_label": "Full name input field",
165
+ "register.field.location_country.label": "Country",
166
+ "register.field.location_state_province.label": "State / Province",
167
+ "register.field.location_suburb.label": "Suburb",
165
168
  "register.field.password.label": "Password",
166
169
  "register.field.password.placeholder": "Enter your password",
167
170
  "register.field.password.aria_label": "Password input field",
@@ -608,6 +611,12 @@
608
611
  "my_settings.toast.password_error": "Failed to change password",
609
612
  "my_settings.toast.profile_picture_success": "Profile picture updated successfully",
610
613
  "my_settings.toast.profile_picture_error": "Failed to update profile picture",
614
+ "my_settings.toast.location_success": "Location updated successfully",
615
+ "my_settings.toast.location_error": "Failed to update location",
616
+ "my_settings.location_label_default": "Location",
617
+ "my_settings.location.country_label": "Country",
618
+ "my_settings.location.state_province_label": "State / Province",
619
+ "my_settings.location.suburb_label": "Suburb",
611
620
  "my_settings.toast.profile_picture_removed": "Profile picture removed successfully",
612
621
  "my_settings.toast.profile_picture_remove_error": "Failed to remove profile picture",
613
622
  "user_management.table.photo": "Photo",
@@ -21,6 +21,14 @@ export type MySettingsPageProps = {
21
21
  show_email_field?: boolean;
22
22
  show_password_field?: boolean;
23
23
  };
24
+ /** Which indexed location fields to show as an editable "Location" card.
25
+ * All default to false — this manual-config entry point has no INI file to
26
+ * read, unlike the zero-config `server_pages/my_settings.tsx`. */
27
+ locationFields?: {
28
+ country?: boolean;
29
+ state_province?: boolean;
30
+ suburb?: boolean;
31
+ };
24
32
  passwordRequirements?: Partial<PasswordRequirementOptions>;
25
33
  profilePicture?: {
26
34
  allow_photo_upload?: boolean;
@@ -64,6 +72,6 @@ export type MySettingsPageProps = {
64
72
  * @param props - Optional configuration overrides
65
73
  * @returns My settings page component
66
74
  */
67
- export declare function MySettingsPage({ userFields, passwordRequirements, profilePicture, heading: headingProp, subHeading: subHeadingProp, profilePhotoLabel: profilePhotoLabelProp, profilePhotoRecommendation, uploadPhotoButtonLabel: uploadPhotoButtonLabelProp, removePhotoButtonLabel: removePhotoButtonLabelProp, profileInformationLabel: profileInformationLabelProp, passwordLabel: passwordLabelProp, currentPasswordLabel: currentPasswordLabelProp, newPasswordLabel: newPasswordLabelProp, confirmPasswordLabel: confirmPasswordLabelProp, savePasswordButtonLabel, unauthorizedMessage: unauthorizedMessageProp, loginButtonLabel: loginButtonLabelProp, loginPath, enableAccountDeletion, messages, uiSizes, fileTypes, }?: MySettingsPageProps): import("react").JSX.Element;
75
+ export declare function MySettingsPage({ userFields, locationFields, passwordRequirements, profilePicture, heading: headingProp, subHeading: subHeadingProp, profilePhotoLabel: profilePhotoLabelProp, profilePhotoRecommendation, uploadPhotoButtonLabel: uploadPhotoButtonLabelProp, removePhotoButtonLabel: removePhotoButtonLabelProp, profileInformationLabel: profileInformationLabelProp, passwordLabel: passwordLabelProp, currentPasswordLabel: currentPasswordLabelProp, newPasswordLabel: newPasswordLabelProp, confirmPasswordLabel: confirmPasswordLabelProp, savePasswordButtonLabel, unauthorizedMessage: unauthorizedMessageProp, loginButtonLabel: loginButtonLabelProp, loginPath, enableAccountDeletion, messages, uiSizes, fileTypes, }?: MySettingsPageProps): import("react").JSX.Element;
68
76
  export default MySettingsPage;
69
77
  //# sourceMappingURL=my_settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"my_settings.d.ts","sourceRoot":"","sources":["../../src/page_components/my_settings.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AA4B3G,QAAA,MAAM,gBAAgB;;;;;CAKrB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;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C,CAAC;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE;QACV,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;QACpC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;KACrC,CAAC;CACH,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,cAAc,EAC1B,iBAAiB,EAAE,qBAAqB,EACxC,0BAAiF,EACjF,sBAAsB,EAAE,0BAA0B,EAClD,sBAAsB,EAAE,0BAA0B,EAClD,uBAAuB,EAAE,2BAA2B,EACpD,aAAa,EAAE,iBAAiB,EAChC,oBAAoB,EAAE,wBAAwB,EAC9C,gBAAgB,EAAE,oBAAoB,EACtC,oBAAoB,EAAE,wBAAwB,EAC9C,uBAA2C,EAC3C,mBAAmB,EAAE,uBAAuB,EAC5C,gBAAgB,EAAE,oBAAoB,EACtC,SAA8B,EAC9B,qBAA6B,EAC7B,QAAQ,EACR,OAAO,EACP,SAAS,GACV,GAAE,mBAAwB,+BA+E1B;AAED,eAAe,cAAc,CAAC"}
@@ -11,6 +11,11 @@ const DEFAULT_USER_FIELDS = {
11
11
  show_email_field: true,
12
12
  show_password_field: true,
13
13
  };
14
+ const DEFAULT_LOCATION_FIELDS = {
15
+ country: false,
16
+ state_province: false,
17
+ suburb: false,
18
+ };
14
19
  const DEFAULT_PASSWORD_REQUIREMENTS = {
15
20
  minimum_length: 8,
16
21
  require_uppercase: true,
@@ -54,7 +59,7 @@ const DEFAULT_FILE_TYPES = {
54
59
  * @param props - Optional configuration overrides
55
60
  * @returns My settings page component
56
61
  */
57
- export function MySettingsPage({ userFields, passwordRequirements, profilePicture, heading: headingProp, subHeading: subHeadingProp, profilePhotoLabel: profilePhotoLabelProp, profilePhotoRecommendation = "Recommended: Square image, at least 200x200 pixels", uploadPhotoButtonLabel: uploadPhotoButtonLabelProp, removePhotoButtonLabel: removePhotoButtonLabelProp, profileInformationLabel: profileInformationLabelProp, passwordLabel: passwordLabelProp, currentPasswordLabel: currentPasswordLabelProp, newPasswordLabel: newPasswordLabelProp, confirmPasswordLabel: confirmPasswordLabelProp, savePasswordButtonLabel = "Update Password", unauthorizedMessage: unauthorizedMessageProp, loginButtonLabel: loginButtonLabelProp, loginPath = "/hazo_auth/login", enableAccountDeletion = false, messages, uiSizes, fileTypes, } = {}) {
62
+ export function MySettingsPage({ userFields, locationFields, passwordRequirements, profilePicture, heading: headingProp, subHeading: subHeadingProp, profilePhotoLabel: profilePhotoLabelProp, profilePhotoRecommendation = "Recommended: Square image, at least 200x200 pixels", uploadPhotoButtonLabel: uploadPhotoButtonLabelProp, removePhotoButtonLabel: removePhotoButtonLabelProp, profileInformationLabel: profileInformationLabelProp, passwordLabel: passwordLabelProp, currentPasswordLabel: currentPasswordLabelProp, newPasswordLabel: newPasswordLabelProp, confirmPasswordLabel: confirmPasswordLabelProp, savePasswordButtonLabel = "Update Password", unauthorizedMessage: unauthorizedMessageProp, loginButtonLabel: loginButtonLabelProp, loginPath = "/hazo_auth/login", enableAccountDeletion = false, messages, uiSizes, fileTypes, } = {}) {
58
63
  const t = useAuthT();
59
64
  const heading = headingProp !== null && headingProp !== void 0 ? headingProp : t("my_settings.page_title");
60
65
  const subHeading = subHeadingProp !== null && subHeadingProp !== void 0 ? subHeadingProp : t("my_settings.sub_heading_default");
@@ -70,12 +75,13 @@ export function MySettingsPage({ userFields, passwordRequirements, profilePictur
70
75
  const loginButtonLabel = loginButtonLabelProp !== null && loginButtonLabelProp !== void 0 ? loginButtonLabelProp : t("shared.guard.login_button_default");
71
76
  // Merge provided props with defaults
72
77
  const mergedUserFields = Object.assign(Object.assign({}, DEFAULT_USER_FIELDS), userFields);
78
+ const mergedLocationFields = Object.assign(Object.assign({}, DEFAULT_LOCATION_FIELDS), locationFields);
73
79
  const mergedPasswordRequirements = Object.assign(Object.assign({}, DEFAULT_PASSWORD_REQUIREMENTS), passwordRequirements);
74
80
  const mergedProfilePicture = Object.assign(Object.assign({}, DEFAULT_PROFILE_PICTURE), profilePicture);
75
81
  const mergedMessages = Object.assign(Object.assign({}, DEFAULT_MESSAGES), messages);
76
82
  const mergedUiSizes = Object.assign(Object.assign({}, DEFAULT_UI_SIZES), uiSizes);
77
83
  const mergedFileTypes = Object.assign(Object.assign({}, DEFAULT_FILE_TYPES), fileTypes);
78
84
  const MySettingsLayout = my_settings_layout;
79
- return (_jsx(MySettingsLayout, { userFields: mergedUserFields, password_requirements: mergedPasswordRequirements, profilePicture: mergedProfilePicture, heading: heading, subHeading: subHeading, profilePhotoLabel: profilePhotoLabel, profilePhotoRecommendation: profilePhotoRecommendation, uploadPhotoButtonLabel: uploadPhotoButtonLabel, removePhotoButtonLabel: removePhotoButtonLabel, profileInformationLabel: profileInformationLabel, passwordLabel: passwordLabel, currentPasswordLabel: currentPasswordLabel, newPasswordLabel: newPasswordLabel, confirmPasswordLabel: confirmPasswordLabel, unauthorizedMessage: unauthorizedMessage, loginButtonLabel: loginButtonLabel, loginPath: loginPath, enableAccountDeletion: enableAccountDeletion, messages: mergedMessages, uiSizes: mergedUiSizes, fileTypes: mergedFileTypes }));
85
+ return (_jsx(MySettingsLayout, { userFields: mergedUserFields, locationFields: mergedLocationFields, password_requirements: mergedPasswordRequirements, profilePicture: mergedProfilePicture, heading: heading, subHeading: subHeading, profilePhotoLabel: profilePhotoLabel, profilePhotoRecommendation: profilePhotoRecommendation, uploadPhotoButtonLabel: uploadPhotoButtonLabel, removePhotoButtonLabel: removePhotoButtonLabel, profileInformationLabel: profileInformationLabel, passwordLabel: passwordLabel, currentPasswordLabel: currentPasswordLabel, newPasswordLabel: newPasswordLabel, confirmPasswordLabel: confirmPasswordLabel, unauthorizedMessage: unauthorizedMessage, loginButtonLabel: loginButtonLabel, loginPath: loginPath, enableAccountDeletion: enableAccountDeletion, messages: mergedMessages, uiSizes: mergedUiSizes, fileTypes: mergedFileTypes }));
80
86
  }
81
87
  export default MySettingsPage;
@@ -1 +1 @@
1
- {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/server/routes/me.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAoBxD;;;;;GAKG;AACH,wBAAsB,GAAG,CAAC,OAAO,EAAE,WAAW;;IAmH7C"}
1
+ {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/server/routes/me.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAoBxD;;;;;GAKG;AACH,wBAAsB,GAAG,CAAC,OAAO,EAAE,WAAW;;IAuH7C"}
@@ -24,7 +24,7 @@ function strip_sentinel_email(email) {
24
24
  * Always returns the same format to prevent downstream variations.
25
25
  */
26
26
  export async function GET(request) {
27
- var _a, _b;
27
+ var _a, _b, _c, _d, _e;
28
28
  const logger = create_app_logger();
29
29
  try {
30
30
  // Use hazo_get_auth to get user with permissions
@@ -99,6 +99,10 @@ export async function GET(request) {
99
99
  legal_acceptance: (_a = auth_result.user.legal_acceptance) !== null && _a !== void 0 ? _a : null,
100
100
  // User's explicit locale preference (BCP 47 tag), or null if unset
101
101
  preferred_locale: (_b = auth_result.user.preferred_locale) !== null && _b !== void 0 ? _b : null,
102
+ // Indexed location fields (null unless enabled + set — see location_fields_config.server.ts)
103
+ country: (_c = auth_result.user.country) !== null && _c !== void 0 ? _c : null,
104
+ state_province: (_d = auth_result.user.state_province) !== null && _d !== void 0 ? _d : null,
105
+ suburb: (_e = auth_result.user.suburb) !== null && _e !== void 0 ? _e : null,
102
106
  // Permissions and user object (always included)
103
107
  user: auth_result.user,
104
108
  permissions: auth_result.permissions,
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/server/routes/register.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAWxD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW;;;;;;IAgI9C"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/server/routes/register.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiDxD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW;;;;;;IAoI9C"}
@@ -9,6 +9,48 @@ import { sanitize_error_for_user } from "../../lib/utils/error_sanitizer.js";
9
9
  import { get_legal_docs_config } from "../../lib/legal/legal_docs_config.server.js";
10
10
  import { read_legal_doc } from "../../lib/legal/legal_docs_reader.server.js";
11
11
  import { get_client_ip } from "../../lib/auth/hazo_get_auth.server.js";
12
+ import { get_location_fields_config } from "../../lib/location_fields_config.server.js";
13
+ import { get_app_user_data_schema } from "../../lib/app_user_data_config.server.js";
14
+ // section: helpers
15
+ /**
16
+ * Keeps only the location fields the app has actually enabled via
17
+ * `[hazo_auth__custom_fields]` — never trust the client-side field visibility
18
+ * alone (same rationale as every other server-side re-validation in this file).
19
+ */
20
+ function pick_enabled_location_fields(raw) {
21
+ if (!raw || typeof raw !== "object")
22
+ return undefined;
23
+ const enabled = get_location_fields_config();
24
+ const result = {};
25
+ const source = raw;
26
+ if (enabled.country && typeof source.country === "string")
27
+ result.country = source.country;
28
+ if (enabled.state_province && typeof source.state_province === "string")
29
+ result.state_province = source.state_province;
30
+ if (enabled.suburb && typeof source.suburb === "string")
31
+ result.suburb = source.suburb;
32
+ return Object.keys(result).length > 0 ? result : undefined;
33
+ }
34
+ /**
35
+ * Keeps only the custom field keys present in the configured app_user_data
36
+ * JSON Schema — a consumer can't stuff arbitrary keys into app_user_data at
37
+ * signup just because the request body included them.
38
+ */
39
+ function pick_schema_custom_fields(raw) {
40
+ if (!raw || typeof raw !== "object")
41
+ return undefined;
42
+ const schema = get_app_user_data_schema();
43
+ if (!schema)
44
+ return undefined;
45
+ const allowed_keys = Object.keys(schema.properties);
46
+ const source = raw;
47
+ const result = {};
48
+ for (const key of allowed_keys) {
49
+ if (key in source)
50
+ result[key] = source[key];
51
+ }
52
+ return Object.keys(result).length > 0 ? result : undefined;
53
+ }
12
54
  // section: api_handler
13
55
  export async function POST(request) {
14
56
  var _a;
@@ -17,6 +59,8 @@ export async function POST(request) {
17
59
  const body = await request.json();
18
60
  const { name, email, password, url_on_logon } = body;
19
61
  const legal_accepted = body === null || body === void 0 ? void 0 : body.legal_accepted;
62
+ const location = pick_enabled_location_fields(body === null || body === void 0 ? void 0 : body.location);
63
+ const custom_fields = pick_schema_custom_fields(body === null || body === void 0 ? void 0 : body.custom_fields);
20
64
  // Validate input
21
65
  if (!email || !password) {
22
66
  logger.warn("registration_validation_failed", {
@@ -66,6 +110,8 @@ export async function POST(request) {
66
110
  legal_accepted,
67
111
  ip: get_client_ip(request),
68
112
  user_agent: request.headers.get('user-agent'),
113
+ location,
114
+ custom_fields,
69
115
  });
70
116
  if (!result.success) {
71
117
  const status_code = result.error === "Email address already registered" ? 409 : 500;
@@ -1 +1 @@
1
- {"version":3,"file":"update_user.d.ts","sourceRoot":"","sources":["../../../src/server/routes/update_user.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA0BxD,wBAAsB,KAAK,CAAC,OAAO,EAAE,WAAW;;;;;;IAyI/C"}
1
+ {"version":3,"file":"update_user.d.ts","sourceRoot":"","sources":["../../../src/server/routes/update_user.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA4CxD,wBAAsB,KAAK,CAAC,OAAO,EAAE,WAAW;;;;;;IA4I/C"}
@@ -7,6 +7,26 @@ import { update_user_profile } from "../../lib/services/user_update_service.js";
7
7
  import { get_filename, get_line_number } from "../../lib/utils/api_route_helpers.js";
8
8
  import { require_auth } from "../../lib/auth/auth_utils.server.js";
9
9
  import { get_cookie_name, get_cookie_options, BASE_COOKIE_NAMES } from "../../lib/cookies_config.server.js";
10
+ import { get_location_fields_config } from "../../lib/location_fields_config.server.js";
11
+ // section: helpers
12
+ /**
13
+ * Keeps only the location fields the app has enabled via
14
+ * `[hazo_auth__custom_fields]` — same re-validation as the register route.
15
+ */
16
+ function pick_enabled_location_fields(raw) {
17
+ if (!raw || typeof raw !== "object")
18
+ return undefined;
19
+ const enabled = get_location_fields_config();
20
+ const result = {};
21
+ const source = raw;
22
+ if (enabled.country && typeof source.country === "string")
23
+ result.country = source.country;
24
+ if (enabled.state_province && typeof source.state_province === "string")
25
+ result.state_province = source.state_province;
26
+ if (enabled.suburb && typeof source.suburb === "string")
27
+ result.suburb = source.suburb;
28
+ return Object.keys(result).length > 0 ? result : undefined;
29
+ }
10
30
  // section: constants
11
31
  // BCP 47 language tag, optionally followed by a region/script subtag
12
32
  // (e.g. "en", "en-US", "pt-BR", "zh-Hans"). Deliberately NOT an allowlist — any
@@ -46,11 +66,13 @@ export async function PATCH(request) {
46
66
  }
47
67
  const body = await request.json();
48
68
  const { name, email, profile_picture_url, profile_source, preferred_locale } = body;
69
+ const location = pick_enabled_location_fields(body === null || body === void 0 ? void 0 : body.location);
49
70
  // Validate input (at least one field must be provided)
50
71
  if (name === undefined &&
51
72
  email === undefined &&
52
73
  profile_picture_url === undefined &&
53
- preferred_locale === undefined) {
74
+ preferred_locale === undefined &&
75
+ location === undefined) {
54
76
  logger.warn("user_update_validation_failed", {
55
77
  filename: get_filename(),
56
78
  line_number: get_line_number(),
@@ -77,6 +99,7 @@ export async function PATCH(request) {
77
99
  profile_picture_url,
78
100
  profile_source,
79
101
  preferred_locale,
102
+ location,
80
103
  });
81
104
  if (!result.success) {
82
105
  logger.warn("user_update_failed", {
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/server_pages/login.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa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QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEvD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,MAAqB,EACrB,cAAc,EACd,aAAqB,GACtB,GAAE,cAAmB,+BA0ErB;AAGD,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -45,7 +45,7 @@ export default function LoginPage({ image_src, image_alt, image_background_color
45
45
  const finalImageSrc = image_src || config.imageSrc;
46
46
  const finalImageAlt = image_alt || config.imageAlt;
47
47
  const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
48
- 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: {
48
+ 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, alreadyLoggedInRedirectPath: config.alreadyLoggedInRedirectPath, forgotPasswordPath: config.forgotPasswordPath, forgotPasswordLabel: config.forgotPasswordLabel, createAccountPath: config.createAccountPath, createAccountLabel: config.createAccountLabel, showCreateAccountLink: config.showCreateAccountLink, oauth: {
49
49
  enable_google: config.oauth.enable_google,
50
50
  enable_email_password: config.oauth.enable_email_password,
51
51
  google_button_text: config.oauth.google_button_text,
@@ -24,5 +24,5 @@ export type LoginClientWrapperProps = Omit<LoginConfig, 'imageSrc' | 'imageAlt'
24
24
  * Client wrapper for LoginLayout
25
25
  * Initializes hazo_connect data client on client side and passes config from server
26
26
  */
27
- 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, labels, defaultValues, }: LoginClientWrapperProps): import("react").JSX.Element;
27
+ export declare function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, alreadyLoggedInRedirectPath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink, oauth, layout, labels, defaultValues, }: LoginClientWrapperProps): import("react").JSX.Element;
28
28
  //# 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;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAIrG,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;IACpC,wEAAwE;IACxE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,+EAA+E;IAC/E,aAAa,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD,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,EACrB,MAAM,EACN,aAAa,GACd,EAAE,uBAAuB,+BA6CzB"}
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;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAIrG,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;IACpC,wEAAwE;IACxE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,+EAA+E;IAC/E,aAAa,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD,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,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,qBAA4B,EAC5B,KAAK,EACL,MAAqB,EACrB,MAAM,EACN,aAAa,GACd,EAAE,uBAAuB,+BA8CzB"}
@@ -12,7 +12,7 @@ import { useAuthT } from "../contexts/hazo_auth_provider.js";
12
12
  * Client wrapper for LoginLayout
13
13
  * Initializes hazo_connect data client on client side and passes config from server
14
14
  */
15
- 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", labels, defaultValues, }) {
15
+ export function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, alreadyLoggedInRedirectPath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink = true, oauth, layout = "two_column", labels, defaultValues, }) {
16
16
  const t = useAuthT();
17
17
  const [dataClient, setDataClient] = useState(null);
18
18
  useEffect(() => {
@@ -25,5 +25,5 @@ export function LoginClientWrapper({ image_src, image_alt, image_background_colo
25
25
  if (!dataClient) {
26
26
  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: t("shared.guard.loading") }) }));
27
27
  }
28
- 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, labels: labels, default_values: defaultValues }));
28
+ 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, alreadyLoggedInRedirectPath: alreadyLoggedInRedirectPath, 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, labels: labels, default_values: defaultValues }));
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"my_settings.d.ts","sourceRoot":"","sources":["../../src/server_pages/my_settings.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,GACV,GAAE,mBAAwB,+BAiC1B;AAGD,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"my_settings.d.ts","sourceRoot":"","sources":["../../src/server_pages/my_settings.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,GACV,GAAE,mBAAwB,+BAkC1B;AAGD,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -56,7 +56,7 @@ export default function MySettingsPage({ className, } = {}) {
56
56
  // Load configuration from INI file (with defaults)
57
57
  const config = get_my_settings_config();
58
58
  // Render layout with all server-initialized configuration, wrapped in AuthPageShell for navbar support
59
- return (_jsx(AuthPageShell, { children: _jsx(MySettingsLayout, { className: className, password_requirements: config.passwordRequirements, profilePicture: config.profilePicture, userFields: config.userFields, unauthorizedMessage: config.unauthorizedMessage, loginButtonLabel: config.loginButtonLabel, loginPath: config.loginPath, enableAccountDeletion: config.enableAccountDeletion, heading: config.heading, subHeading: config.subHeading, profilePhotoLabel: config.profilePhotoLabel, profilePhotoRecommendation: config.profilePhotoRecommendation, uploadPhotoButtonLabel: config.uploadPhotoButtonLabel, removePhotoButtonLabel: config.removePhotoButtonLabel, profileInformationLabel: config.profileInformationLabel, passwordLabel: config.passwordLabel, currentPasswordLabel: config.currentPasswordLabel, newPasswordLabel: config.newPasswordLabel, confirmPasswordLabel: config.confirmPasswordLabel, messages: config.messages, uiSizes: config.uiSizes, fileTypes: config.fileTypes }) }));
59
+ return (_jsx(AuthPageShell, { children: _jsx(MySettingsLayout, { className: className, password_requirements: config.passwordRequirements, profilePicture: config.profilePicture, userFields: config.userFields, locationFields: config.locationFields, unauthorizedMessage: config.unauthorizedMessage, loginButtonLabel: config.loginButtonLabel, loginPath: config.loginPath, enableAccountDeletion: config.enableAccountDeletion, heading: config.heading, subHeading: config.subHeading, profilePhotoLabel: config.profilePhotoLabel, profilePhotoRecommendation: config.profilePhotoRecommendation, uploadPhotoButtonLabel: config.uploadPhotoButtonLabel, removePhotoButtonLabel: config.removePhotoButtonLabel, profileInformationLabel: config.profileInformationLabel, passwordLabel: config.passwordLabel, currentPasswordLabel: config.currentPasswordLabel, newPasswordLabel: config.newPasswordLabel, confirmPasswordLabel: config.confirmPasswordLabel, messages: config.messages, uiSizes: config.uiSizes, fileTypes: config.fileTypes }) }));
60
60
  }
61
61
  // Named export for direct imports
62
62
  export { MySettingsPage };
@@ -1 +1 @@
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;IAEpC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,MAAqB,EACrB,aAAqB,GACtB,GAAE,iBAAsB,+BA4DxB;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;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;IAEpC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,MAAqB,EACrB,aAAqB,GACtB,GAAE,iBAAsB,+BA8DxB;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -45,7 +45,7 @@ export default function RegisterPage({ image_src, image_alt, image_background_co
45
45
  const finalImageSrc = image_src || config.imageSrc;
46
46
  const finalImageAlt = image_alt || config.imageAlt;
47
47
  const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
48
- 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: {
48
+ 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, locationFields: config.locationFields, customFieldsSchema: config.customFieldsSchema, oauth: {
49
49
  enable_google: config.oauth.enable_google,
50
50
  enable_email_password: config.oauth.enable_email_password,
51
51
  google_button_text: config.oauth.google_button_text,
@@ -2,7 +2,9 @@ import type { RegisterConfig } from "../lib/register_config.server";
2
2
  import type { OAuthLayoutConfig } from "../components/layouts/register/index";
3
3
  import type { LayoutLabelOverrides } from "../components/layouts/shared/config/layout_customization";
4
4
  import type { StaticImageData } from "next/image";
5
- export type RegisterClientWrapperProps = Omit<RegisterConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor' | 'oauth'> & {
5
+ export type RegisterClientWrapperProps = Omit<RegisterConfig, 'imageSrc' | 'imageAlt' | 'imageBackgroundColor' | 'oauth' | 'locationFields' | 'customFieldsSchema'> & {
6
+ locationFields?: RegisterConfig['locationFields'];
7
+ customFieldsSchema?: RegisterConfig['customFieldsSchema'];
6
8
  image_src?: string | StaticImageData;
7
9
  image_alt?: string;
8
10
  image_background_color?: string;
@@ -16,5 +18,5 @@ export type RegisterClientWrapperProps = Omit<RegisterConfig, 'imageSrc' | 'imag
16
18
  * Client wrapper for RegisterLayout
17
19
  * Initializes hazo_connect data client on client side and passes config from server
18
20
  */
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.Element;
21
+ export declare function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, layout, labels, locationFields, customFieldsSchema, }: RegisterClientWrapperProps): import("react").JSX.Element;
20
22
  //# sourceMappingURL=register_client_wrapper.d.ts.map