hazo_auth 10.24.0 → 10.25.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/cli-src/lib/auth/auth_types.ts +6 -0
- package/cli-src/lib/auth/hazo_get_auth.server.ts +3 -0
- package/cli-src/lib/location_fields_config.server.ts +42 -0
- package/cli-src/lib/my_settings_config.server.ts +6 -0
- package/cli-src/lib/register_config.server.ts +16 -0
- package/cli-src/lib/services/location_fields_helper.ts +30 -0
- package/cli-src/lib/services/registration_service.ts +21 -0
- package/cli-src/lib/services/user_update_service.ts +7 -0
- package/dist/components/layouts/my_settings/hooks/use_my_settings.d.ts +8 -0
- package/dist/components/layouts/my_settings/hooks/use_my_settings.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/hooks/use_my_settings.js +37 -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 -3
- package/dist/components/layouts/register/hooks/use_register_form.d.ts +15 -1
- package/dist/components/layouts/register/hooks/use_register_form.d.ts.map +1 -1
- package/dist/components/layouts/register/hooks/use_register_form.js +69 -4
- package/dist/components/layouts/register/index.d.ts +7 -1
- package/dist/components/layouts/register/index.d.ts.map +1 -1
- package/dist/components/layouts/register/index.js +24 -3
- package/dist/components/layouts/shared/hooks/use_auth_status.d.ts +3 -0
- package/dist/components/layouts/shared/hooks/use_auth_status.d.ts.map +1 -1
- package/dist/components/layouts/shared/hooks/use_auth_status.js +5 -2
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/lib/auth/auth_types.d.ts +3 -0
- package/dist/lib/auth/auth_types.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.js +3 -0
- package/dist/lib/location_fields_config.server.d.ts +22 -0
- package/dist/lib/location_fields_config.server.d.ts.map +1 -0
- package/dist/lib/location_fields_config.server.js +31 -0
- package/dist/lib/my_settings_config.server.d.ts +4 -0
- package/dist/lib/my_settings_config.server.d.ts.map +1 -1
- package/dist/lib/my_settings_config.server.js +3 -0
- package/dist/lib/register_config.server.d.ts +10 -0
- package/dist/lib/register_config.server.d.ts.map +1 -1
- package/dist/lib/register_config.server.js +7 -0
- package/dist/lib/services/location_fields_helper.d.ts +13 -0
- package/dist/lib/services/location_fields_helper.d.ts.map +1 -0
- package/dist/lib/services/location_fields_helper.js +24 -0
- package/dist/lib/services/registration_service.d.ts +9 -0
- package/dist/lib/services/registration_service.d.ts.map +1 -1
- package/dist/lib/services/registration_service.js +11 -0
- package/dist/lib/services/user_update_service.d.ts +5 -0
- package/dist/lib/services/user_update_service.d.ts.map +1 -1
- package/dist/lib/services/user_update_service.js +2 -0
- package/dist/locales/en.json +9 -0
- package/dist/page_components/my_settings.d.ts +9 -1
- package/dist/page_components/my_settings.d.ts.map +1 -1
- package/dist/page_components/my_settings.js +8 -2
- package/dist/server/routes/me.d.ts.map +1 -1
- package/dist/server/routes/me.js +5 -1
- package/dist/server/routes/register.d.ts.map +1 -1
- package/dist/server/routes/register.js +46 -0
- package/dist/server/routes/update_user.d.ts.map +1 -1
- package/dist/server/routes/update_user.js +24 -1
- package/dist/server_pages/my_settings.d.ts.map +1 -1
- package/dist/server_pages/my_settings.js +1 -1
- package/dist/server_pages/register.d.ts.map +1 -1
- package/dist/server_pages/register.js +1 -1
- package/dist/server_pages/register_client_wrapper.d.ts +4 -2
- package/dist/server_pages/register_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/register_client_wrapper.js +2 -2
- package/package.json +4 -4
|
@@ -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;;
|
|
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"}
|
package/dist/server/routes/me.js
CHANGED
|
@@ -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;
|
|
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;
|
|
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":"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,+
|
|
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,+
|
|
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
|
|
@@ -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;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAIrG,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;
|
|
1
|
+
{"version":3,"file":"register_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/register_client_wrapper.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAIrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,GAAG,OAAO,GAAG,gBAAgB,GAAG,oBAAoB,CAAC,GAAG;IACpK,cAAc,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAClD,kBAAkB,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAC;IAC1D,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IACpC,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B,CAAC;AAGF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,WAAW,EACX,KAAK,EACL,MAAqB,EACrB,MAAM,EACN,cAAc,EACd,kBAAkB,GACnB,EAAE,0BAA0B,+BA2C5B"}
|
|
@@ -12,7 +12,7 @@ import { useAuthT } from "../contexts/hazo_auth_provider.js";
|
|
|
12
12
|
* Client wrapper for RegisterLayout
|
|
13
13
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
14
14
|
*/
|
|
15
|
-
export function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, layout = "two_column", labels, }) {
|
|
15
|
+
export function RegisterClientWrapper({ image_src, image_alt, image_background_color, showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, oauth, layout = "two_column", labels, locationFields, customFieldsSchema, }) {
|
|
16
16
|
const t = useAuthT();
|
|
17
17
|
const [dataClient, setDataClient] = useState(null);
|
|
18
18
|
useEffect(() => {
|
|
@@ -25,5 +25,5 @@ export function RegisterClientWrapper({ image_src, image_alt, image_background_c
|
|
|
25
25
|
if (!dataClient) {
|
|
26
26
|
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: t("shared.guard.loading") }) }));
|
|
27
27
|
}
|
|
28
|
-
return (_jsx(RegisterLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, show_name_field: showNameField, password_requirements: passwordRequirements, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, signInPath: signInPath, signInLabel: signInLabel, oauth: oauth, layout: layout, labels: labels }));
|
|
28
|
+
return (_jsx(RegisterLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, show_name_field: showNameField, password_requirements: passwordRequirements, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, signInPath: signInPath, signInLabel: signInLabel, oauth: oauth, layout: layout, labels: labels, locationFields: locationFields, customFieldsSchema: customFieldsSchema }));
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_auth",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.25.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",
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
"peerDependencies": {
|
|
278
278
|
"hazo_config": "^2.6.0",
|
|
279
279
|
"hazo_connect": "^4.3.3",
|
|
280
|
-
"hazo_core": "^2.4.
|
|
280
|
+
"hazo_core": "^2.4.1",
|
|
281
281
|
"hazo_i18n": "^0.9.0",
|
|
282
282
|
"hazo_logs": "^2.3.0",
|
|
283
283
|
"hazo_notify": "^6.7.0",
|
|
@@ -364,11 +364,11 @@
|
|
|
364
364
|
"hazo_api": "^2.8.0",
|
|
365
365
|
"hazo_config": "^2.6.0",
|
|
366
366
|
"hazo_connect": "^4.3.3",
|
|
367
|
-
"hazo_core": "^2.
|
|
367
|
+
"hazo_core": "^2.5.0",
|
|
368
368
|
"hazo_logs": "^2.3.0",
|
|
369
369
|
"hazo_notify": "^6.7.0",
|
|
370
370
|
"hazo_theme": "^1.4.0",
|
|
371
|
-
"hazo_ui": "^6.
|
|
371
|
+
"hazo_ui": "^6.16.0",
|
|
372
372
|
"input-otp": "^1.4.0",
|
|
373
373
|
"jest": "^30.2.0",
|
|
374
374
|
"jest-environment-jsdom": "^30.0.0",
|