hazo_auth 6.1.1 → 7.0.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.
- package/README.md +163 -8
- package/SETUP_CHECKLIST.md +148 -0
- package/cli-src/lib/auth/nextauth_config.ts +101 -1
- package/cli-src/lib/email_verification_config.server.ts +0 -34
- package/cli-src/lib/forgot_password_config.server.ts +0 -34
- package/cli-src/lib/login_config.server.ts +0 -31
- package/cli-src/lib/my_settings_config.server.ts +0 -3
- package/cli-src/lib/oauth_config.server.ts +58 -0
- package/cli-src/lib/register_config.server.ts +11 -31
- package/cli-src/lib/reset_password_config.server.ts +0 -31
- package/cli-src/lib/services/oauth_service.ts +197 -0
- package/config/hazo_auth_config.example.ini +38 -41
- package/dist/components/layouts/create_firm/index.d.ts +4 -8
- package/dist/components/layouts/create_firm/index.d.ts.map +1 -1
- package/dist/components/layouts/create_firm/index.js +3 -3
- package/dist/components/layouts/email_verification/index.d.ts +4 -5
- package/dist/components/layouts/email_verification/index.d.ts.map +1 -1
- package/dist/components/layouts/email_verification/index.js +4 -4
- package/dist/components/layouts/forgot_password/index.d.ts +4 -5
- package/dist/components/layouts/forgot_password/index.d.ts.map +1 -1
- package/dist/components/layouts/forgot_password/index.js +2 -2
- package/dist/components/layouts/login/index.d.ts +13 -9
- package/dist/components/layouts/login/index.d.ts.map +1 -1
- package/dist/components/layouts/login/index.js +12 -6
- package/dist/components/layouts/otp/index.d.ts +8 -1
- package/dist/components/layouts/otp/index.d.ts.map +1 -1
- package/dist/components/layouts/otp/index.js +4 -2
- package/dist/components/layouts/register/index.d.ts +11 -7
- package/dist/components/layouts/register/index.d.ts.map +1 -1
- package/dist/components/layouts/register/index.js +8 -4
- package/dist/components/layouts/reset_password/index.d.ts +4 -5
- package/dist/components/layouts/reset_password/index.d.ts.map +1 -1
- package/dist/components/layouts/reset_password/index.js +5 -5
- package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts +3 -5
- package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/already_logged_in_guard.js +2 -2
- package/dist/components/layouts/shared/components/facebook_sign_in_button.d.ts +25 -0
- package/dist/components/layouts/shared/components/facebook_sign_in_button.d.ts.map +1 -0
- package/dist/components/layouts/shared/components/facebook_sign_in_button.js +49 -0
- package/dist/components/layouts/shared/components/sidebar_layout_wrapper.js +1 -1
- package/dist/components/layouts/shared/components/two_column_auth_layout.d.ts +3 -6
- package/dist/components/layouts/shared/components/two_column_auth_layout.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/two_column_auth_layout.js +8 -5
- package/dist/consent/consent_state.d.ts +18 -0
- package/dist/consent/consent_state.d.ts.map +1 -0
- package/dist/consent/consent_state.js +29 -0
- package/dist/consent/cookie_consent_banner.d.ts +11 -0
- package/dist/consent/cookie_consent_banner.d.ts.map +1 -0
- package/dist/consent/cookie_consent_banner.js +40 -0
- package/dist/consent/gtm_mapping.d.ts +13 -0
- package/dist/consent/gtm_mapping.d.ts.map +1 -0
- package/dist/consent/gtm_mapping.js +30 -0
- package/dist/consent/index.d.ts +7 -0
- package/dist/consent/index.d.ts.map +1 -0
- package/dist/consent/index.js +7 -0
- package/dist/consent/manage_modal.d.ts +2 -0
- package/dist/consent/manage_modal.d.ts.map +1 -0
- package/dist/consent/manage_modal.js +33 -0
- package/dist/consent/read_consent.d.ts +15 -0
- package/dist/consent/read_consent.d.ts.map +1 -0
- package/dist/consent/read_consent.js +23 -0
- package/dist/consent/use_consent.d.ts +7 -0
- package/dist/consent/use_consent.d.ts.map +1 -0
- package/dist/consent/use_consent.js +55 -0
- package/dist/lib/auth/nextauth_config.d.ts +10 -0
- package/dist/lib/auth/nextauth_config.d.ts.map +1 -1
- package/dist/lib/auth/nextauth_config.js +80 -2
- package/dist/lib/email_verification_config.server.d.ts +0 -3
- package/dist/lib/email_verification_config.server.d.ts.map +1 -1
- package/dist/lib/email_verification_config.server.js +0 -15
- package/dist/lib/forgot_password_config.server.d.ts +0 -3
- package/dist/lib/forgot_password_config.server.d.ts.map +1 -1
- package/dist/lib/forgot_password_config.server.js +0 -15
- package/dist/lib/login_config.server.d.ts +0 -3
- package/dist/lib/login_config.server.d.ts.map +1 -1
- package/dist/lib/login_config.server.js +0 -13
- package/dist/lib/my_settings_config.server.d.ts +0 -1
- package/dist/lib/my_settings_config.server.d.ts.map +1 -1
- package/dist/lib/my_settings_config.server.js +0 -2
- package/dist/lib/oauth_config.server.d.ts +17 -0
- package/dist/lib/oauth_config.server.d.ts.map +1 -1
- package/dist/lib/oauth_config.server.js +25 -0
- package/dist/lib/register_config.server.d.ts +2 -3
- package/dist/lib/register_config.server.d.ts.map +1 -1
- package/dist/lib/register_config.server.js +4 -13
- package/dist/lib/reset_password_config.server.d.ts +0 -3
- package/dist/lib/reset_password_config.server.d.ts.map +1 -1
- package/dist/lib/reset_password_config.server.js +0 -13
- package/dist/lib/services/oauth_service.d.ts +24 -0
- package/dist/lib/services/oauth_service.d.ts.map +1 -1
- package/dist/lib/services/oauth_service.js +155 -0
- package/dist/page_components/create_firm.d.ts +13 -1
- package/dist/page_components/create_firm.d.ts.map +1 -1
- package/dist/page_components/create_firm.js +10 -6
- package/dist/page_components/forgot_password.d.ts +1 -4
- package/dist/page_components/forgot_password.d.ts.map +1 -1
- package/dist/page_components/forgot_password.js +2 -6
- package/dist/page_components/login.d.ts +1 -4
- package/dist/page_components/login.d.ts.map +1 -1
- package/dist/page_components/login.js +2 -6
- package/dist/page_components/register.d.ts +1 -4
- package/dist/page_components/register.d.ts.map +1 -1
- package/dist/page_components/register.js +2 -6
- package/dist/page_components/reset_password.d.ts +1 -4
- package/dist/page_components/reset_password.d.ts.map +1 -1
- package/dist/page_components/reset_password.js +2 -6
- package/dist/page_components/verify_email.d.ts +1 -4
- package/dist/page_components/verify_email.d.ts.map +1 -1
- package/dist/page_components/verify_email.js +2 -6
- package/dist/server/routes/index.d.ts +1 -0
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +1 -0
- package/dist/server/routes/oauth_facebook_callback.d.ts +8 -0
- package/dist/server/routes/oauth_facebook_callback.d.ts.map +1 -0
- package/dist/server/routes/oauth_facebook_callback.js +157 -0
- package/dist/server/routes/oauth_google_callback.js +1 -1
- package/dist/server_pages/forgot_password.d.ts +13 -17
- package/dist/server_pages/forgot_password.d.ts.map +1 -1
- package/dist/server_pages/forgot_password.js +12 -8
- package/dist/server_pages/forgot_password_client_wrapper.d.ts +7 -6
- package/dist/server_pages/forgot_password_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/forgot_password_client_wrapper.js +2 -2
- package/dist/server_pages/login.d.ts +22 -21
- package/dist/server_pages/login.d.ts.map +1 -1
- package/dist/server_pages/login.js +15 -19
- package/dist/server_pages/login_client_wrapper.d.ts +10 -6
- package/dist/server_pages/login_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/login_client_wrapper.js +2 -2
- package/dist/server_pages/my_settings.d.ts +2 -0
- package/dist/server_pages/my_settings.d.ts.map +1 -1
- package/dist/server_pages/my_settings.js +8 -2
- package/dist/server_pages/otp.d.ts +16 -2
- package/dist/server_pages/otp.d.ts.map +1 -1
- package/dist/server_pages/otp.js +10 -3
- package/dist/server_pages/register.d.ts +19 -16
- package/dist/server_pages/register.d.ts.map +1 -1
- package/dist/server_pages/register.js +15 -12
- package/dist/server_pages/register_client_wrapper.d.ts +10 -6
- package/dist/server_pages/register_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/register_client_wrapper.js +2 -2
- package/dist/server_pages/reset_password.d.ts +11 -16
- package/dist/server_pages/reset_password.d.ts.map +1 -1
- package/dist/server_pages/reset_password.js +11 -9
- package/dist/server_pages/reset_password_client_wrapper.d.ts +7 -6
- package/dist/server_pages/reset_password_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/reset_password_client_wrapper.js +2 -2
- package/dist/server_pages/verify_email.d.ts +11 -17
- package/dist/server_pages/verify_email.d.ts.map +1 -1
- package/dist/server_pages/verify_email.js +11 -8
- package/dist/server_pages/verify_email_client_wrapper.d.ts +7 -6
- package/dist/server_pages/verify_email_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/verify_email_client_wrapper.js +2 -2
- package/dist/strings/default_strings.d.ts +47 -0
- package/dist/strings/default_strings.d.ts.map +1 -0
- package/dist/strings/default_strings.js +18 -0
- package/dist/strings/index.d.ts +4 -0
- package/dist/strings/index.d.ts.map +1 -0
- package/dist/strings/index.js +3 -0
- package/dist/strings/strings_context.d.ts +12 -0
- package/dist/strings/strings_context.d.ts.map +1 -0
- package/dist/strings/strings_context.js +23 -0
- package/dist/strings/strings_provider.d.ts +26 -0
- package/dist/strings/strings_provider.d.ts.map +1 -0
- package/dist/strings/strings_provider.js +45 -0
- package/dist/theme/create_theme.d.ts +7 -0
- package/dist/theme/create_theme.d.ts.map +1 -0
- package/dist/theme/create_theme.js +97 -0
- package/dist/theme/hex_to_hsl.d.ts +16 -0
- package/dist/theme/hex_to_hsl.d.ts.map +1 -0
- package/dist/theme/hex_to_hsl.js +110 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +3 -0
- package/dist/theme/luminance.d.ts +11 -0
- package/dist/theme/luminance.d.ts.map +1 -0
- package/dist/theme/luminance.js +45 -0
- package/dist/theme/theme_provider.d.ts +14 -0
- package/dist/theme/theme_provider.d.ts.map +1 -0
- package/dist/theme/theme_provider.js +23 -0
- package/dist/theme/theme_types.d.ts +36 -0
- package/dist/theme/theme_types.d.ts.map +1 -0
- package/dist/theme/theme_types.js +1 -0
- package/dist/themes/index.d.ts +3 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +2 -0
- package/dist/themes/preset_indigo_sunset.d.ts +3 -0
- package/dist/themes/preset_indigo_sunset.d.ts.map +1 -0
- package/dist/themes/preset_indigo_sunset.js +20 -0
- package/dist/themes/preset_neutral.d.ts +3 -0
- package/dist/themes/preset_neutral.d.ts.map +1 -0
- package/dist/themes/preset_neutral.js +14 -0
- package/package.json +19 -2
|
@@ -167,6 +167,161 @@ export async function handle_google_oauth_login(adapter, data) {
|
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Handles Facebook OAuth login/registration flow
|
|
172
|
+
* 1. Check if user exists with facebook_id -> login
|
|
173
|
+
* 2. Check if user exists with email -> link Facebook account (respects auto_link_unverified)
|
|
174
|
+
* 3. Create new user with Facebook data (email_verified always false — never trust Facebook)
|
|
175
|
+
*
|
|
176
|
+
* @param adapter - The hazo_connect adapter instance
|
|
177
|
+
* @param data - Facebook OAuth user data
|
|
178
|
+
* @param opts - Options (auto_link_unverified: whether to link unverified accounts)
|
|
179
|
+
* @returns OAuth login result with user_id and status flags
|
|
180
|
+
*/
|
|
181
|
+
export async function handle_facebook_oauth_login(adapter, data, opts) {
|
|
182
|
+
const logger = create_app_logger();
|
|
183
|
+
try {
|
|
184
|
+
const { facebook_id, email, name, profile_picture_url } = data;
|
|
185
|
+
const users_service = createCrudService(adapter, "hazo_users");
|
|
186
|
+
const now = new Date().toISOString();
|
|
187
|
+
// Step 1: Check if user exists with this facebook_id
|
|
188
|
+
const users_by_facebook_id = await users_service.findBy({ facebook_id });
|
|
189
|
+
if (Array.isArray(users_by_facebook_id) && users_by_facebook_id.length > 0) {
|
|
190
|
+
const user = users_by_facebook_id[0];
|
|
191
|
+
await users_service.updateById(user.id, {
|
|
192
|
+
last_logon: now,
|
|
193
|
+
changed_at: now,
|
|
194
|
+
});
|
|
195
|
+
logger.info("oauth_service_facebook_login_existing_facebook_user", {
|
|
196
|
+
filename: "oauth_service.ts",
|
|
197
|
+
line_number: get_line_number(),
|
|
198
|
+
user_id: user.id,
|
|
199
|
+
email: user.email_address,
|
|
200
|
+
});
|
|
201
|
+
return {
|
|
202
|
+
success: true,
|
|
203
|
+
user_id: user.id,
|
|
204
|
+
is_new_user: false,
|
|
205
|
+
was_linked: false,
|
|
206
|
+
email: user.email_address,
|
|
207
|
+
name: user.name,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
// Step 2: Check if user exists with this email
|
|
211
|
+
if (email) {
|
|
212
|
+
const users_by_email = await users_service.findBy({ email_address: email });
|
|
213
|
+
if (Array.isArray(users_by_email) && users_by_email.length > 0) {
|
|
214
|
+
const user = users_by_email[0];
|
|
215
|
+
const user_email_verified = user.email_verified;
|
|
216
|
+
if (!user_email_verified) {
|
|
217
|
+
if (!(opts === null || opts === void 0 ? void 0 : opts.auto_link_unverified)) {
|
|
218
|
+
return {
|
|
219
|
+
success: false,
|
|
220
|
+
error: "link_blocked_unverified",
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
// auto_link_unverified=true: link but do NOT change email_verified status
|
|
224
|
+
}
|
|
225
|
+
// Link Facebook account to existing user
|
|
226
|
+
const current_auth_providers = user.auth_providers || "email";
|
|
227
|
+
const new_auth_providers = current_auth_providers.includes("facebook")
|
|
228
|
+
? current_auth_providers
|
|
229
|
+
: `${current_auth_providers},facebook`;
|
|
230
|
+
const update_data = {
|
|
231
|
+
facebook_id,
|
|
232
|
+
auth_providers: new_auth_providers,
|
|
233
|
+
last_logon: now,
|
|
234
|
+
changed_at: now,
|
|
235
|
+
};
|
|
236
|
+
// Update name if not set and Facebook provides one
|
|
237
|
+
if (!user.name && name) {
|
|
238
|
+
update_data.name = name;
|
|
239
|
+
}
|
|
240
|
+
// Update profile picture if not set and Facebook provides one
|
|
241
|
+
if (!user.profile_picture_url && profile_picture_url) {
|
|
242
|
+
update_data.profile_picture_url = profile_picture_url;
|
|
243
|
+
update_data.profile_source = "custom";
|
|
244
|
+
}
|
|
245
|
+
await users_service.updateById(user.id, update_data);
|
|
246
|
+
logger.info("oauth_service_facebook_linked_to_existing", {
|
|
247
|
+
filename: "oauth_service.ts",
|
|
248
|
+
line_number: get_line_number(),
|
|
249
|
+
user_id: user.id,
|
|
250
|
+
email,
|
|
251
|
+
was_unverified: !user_email_verified,
|
|
252
|
+
});
|
|
253
|
+
return {
|
|
254
|
+
success: true,
|
|
255
|
+
user_id: user.id,
|
|
256
|
+
is_new_user: false,
|
|
257
|
+
was_linked: true,
|
|
258
|
+
email: user.email_address,
|
|
259
|
+
name: update_data.name || user.name,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Step 3: Create new user with Facebook data
|
|
264
|
+
const user_id = randomUUID();
|
|
265
|
+
const insert_data = {
|
|
266
|
+
id: user_id,
|
|
267
|
+
email_address: email,
|
|
268
|
+
password_hash: "", // Empty string for Facebook-only users
|
|
269
|
+
email_verified: false, // Never trust Facebook's email_verified claim
|
|
270
|
+
status: "ACTIVE",
|
|
271
|
+
login_attempts: 0,
|
|
272
|
+
facebook_id,
|
|
273
|
+
auth_providers: "facebook",
|
|
274
|
+
created_at: now,
|
|
275
|
+
changed_at: now,
|
|
276
|
+
last_logon: now,
|
|
277
|
+
};
|
|
278
|
+
if (name) {
|
|
279
|
+
insert_data.name = name;
|
|
280
|
+
}
|
|
281
|
+
if (profile_picture_url) {
|
|
282
|
+
insert_data.profile_picture_url = profile_picture_url;
|
|
283
|
+
insert_data.profile_source = "custom";
|
|
284
|
+
}
|
|
285
|
+
const inserted_users = await users_service.insert(insert_data);
|
|
286
|
+
if (!Array.isArray(inserted_users) || inserted_users.length === 0) {
|
|
287
|
+
return {
|
|
288
|
+
success: false,
|
|
289
|
+
error: "Failed to create user account",
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
logger.info("oauth_service_facebook_new_user_created", {
|
|
293
|
+
filename: "oauth_service.ts",
|
|
294
|
+
line_number: get_line_number(),
|
|
295
|
+
user_id,
|
|
296
|
+
email,
|
|
297
|
+
});
|
|
298
|
+
return {
|
|
299
|
+
success: true,
|
|
300
|
+
user_id,
|
|
301
|
+
is_new_user: true,
|
|
302
|
+
was_linked: false,
|
|
303
|
+
email: email !== null && email !== void 0 ? email : undefined,
|
|
304
|
+
name,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
const user_friendly_error = sanitize_error_for_user(error, {
|
|
309
|
+
logToConsole: true,
|
|
310
|
+
logToLogger: true,
|
|
311
|
+
logger,
|
|
312
|
+
context: {
|
|
313
|
+
filename: "oauth_service.ts",
|
|
314
|
+
line_number: get_line_number(),
|
|
315
|
+
email: data.email,
|
|
316
|
+
operation: "handle_facebook_oauth_login",
|
|
317
|
+
},
|
|
318
|
+
});
|
|
319
|
+
return {
|
|
320
|
+
success: false,
|
|
321
|
+
error: user_friendly_error,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
}
|
|
170
325
|
/**
|
|
171
326
|
* Links a Google account to an existing user
|
|
172
327
|
* @param adapter - The hazo_connect adapter instance
|
|
@@ -2,7 +2,19 @@ import "server-only";
|
|
|
2
2
|
export type CreateFirmPageProps = {
|
|
3
3
|
/** Disable the navbar wrapper */
|
|
4
4
|
disableNavbar?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Optional theme that controls visual appearance and layout mode.
|
|
7
|
+
* When `theme.layout` is `"split"`, activates the two-column split layout
|
|
8
|
+
* with the brand panel on the left.
|
|
9
|
+
*/
|
|
10
|
+
theme?: import("../theme/theme_types").HazoAuthTheme;
|
|
11
|
+
/** Override the page heading. Falls back to HazoAuthStringsProvider → DEFAULT_STRINGS. */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** Override the page subtitle. Falls back to HazoAuthStringsProvider → DEFAULT_STRINGS. */
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
/** Override the submit button label. Falls back to HazoAuthStringsProvider → DEFAULT_STRINGS. */
|
|
16
|
+
ctaText?: string;
|
|
5
17
|
};
|
|
6
|
-
export default function CreateFirmPage({ disableNavbar }?: CreateFirmPageProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default function CreateFirmPage({ disableNavbar, theme, title, subtitle, ctaText }?: CreateFirmPageProps): import("react/jsx-runtime").JSX.Element;
|
|
7
19
|
export { CreateFirmPage };
|
|
8
20
|
//# sourceMappingURL=create_firm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_firm.d.ts","sourceRoot":"","sources":["../../src/page_components/create_firm.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"create_firm.d.ts","sourceRoot":"","sources":["../../src/page_components/create_firm.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,sBAAsB,EAAE,aAAa,CAAC;IACrD,0FAA0F;IAC1F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAkCF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAE,mBAAwB,2CA6BlH;AAGD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -6,24 +6,28 @@ import "server-only";
|
|
|
6
6
|
import CreateFirmLayout from "../components/layouts/create_firm/index.js";
|
|
7
7
|
import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
|
|
8
8
|
import { get_config_value } from "../lib/config/config_loader.server.js";
|
|
9
|
+
import { DEFAULT_STRINGS, readStrings } from "../strings.js";
|
|
9
10
|
// section: config_loader
|
|
10
11
|
function get_create_firm_config() {
|
|
11
12
|
return {
|
|
12
|
-
image_src: get_config_value("hazo_auth__create_firm", "image_src", "/hazo_auth/images/new_firm_default.jpg"),
|
|
13
|
-
heading: get_config_value("hazo_auth__create_firm", "heading", "Create Your Firm"),
|
|
14
|
-
sub_heading: get_config_value("hazo_auth__create_firm", "sub_heading", "Set up your organisation to get started"),
|
|
15
13
|
firm_name_label: get_config_value("hazo_auth__create_firm", "firm_name_label", "Firm Name"),
|
|
16
14
|
org_structure_label: get_config_value("hazo_auth__create_firm", "org_structure_label", "Organisation Structure"),
|
|
17
15
|
org_structure_default: get_config_value("hazo_auth__create_firm", "org_structure_default", "Headquarters"),
|
|
18
|
-
submit_button_label: get_config_value("hazo_auth__create_firm", "submit_button_label", "Create Firm"),
|
|
19
16
|
success_message: get_config_value("hazo_auth__create_firm", "success_message", "Your firm has been created successfully!"),
|
|
20
17
|
redirect_route: get_config_value("hazo_auth__create_firm", "redirect_route", "/"),
|
|
21
18
|
};
|
|
22
19
|
}
|
|
23
20
|
// section: component
|
|
24
|
-
export default function CreateFirmPage({ disableNavbar } = {}) {
|
|
21
|
+
export default function CreateFirmPage({ disableNavbar, theme, title, subtitle, ctaText } = {}) {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
// Resolve strings: prop > HazoAuthStringsProvider > DEFAULT_STRINGS
|
|
24
|
+
const strings = readStrings();
|
|
25
|
+
const cf_strings = strings.create_firm;
|
|
26
|
+
const resolved_title = (_a = title !== null && title !== void 0 ? title : cf_strings.title) !== null && _a !== void 0 ? _a : DEFAULT_STRINGS.create_firm.title;
|
|
27
|
+
const resolved_subtitle = (_b = subtitle !== null && subtitle !== void 0 ? subtitle : cf_strings.subtitle) !== null && _b !== void 0 ? _b : DEFAULT_STRINGS.create_firm.subtitle;
|
|
28
|
+
const resolved_cta = (_c = ctaText !== null && ctaText !== void 0 ? ctaText : cf_strings.ctaText) !== null && _c !== void 0 ? _c : DEFAULT_STRINGS.create_firm.ctaText;
|
|
25
29
|
const config = get_create_firm_config();
|
|
26
|
-
const layoutContent = (_jsx(CreateFirmLayout, {
|
|
30
|
+
const layoutContent = (_jsx(CreateFirmLayout, { heading: resolved_title, sub_heading: resolved_subtitle, firm_name_label: config.firm_name_label, org_structure_label: config.org_structure_label, default_org_structure: config.org_structure_default, submit_button_label: resolved_cta, success_message: config.success_message, redirect_route: config.redirect_route, theme: theme }));
|
|
27
31
|
if (disableNavbar) {
|
|
28
32
|
return layoutContent;
|
|
29
33
|
}
|
|
@@ -4,9 +4,6 @@ export type ForgotPasswordPageProps = {
|
|
|
4
4
|
showReturnHomeButton?: boolean;
|
|
5
5
|
returnHomeButtonLabel?: string;
|
|
6
6
|
returnHomePath?: string;
|
|
7
|
-
imageSrc?: string;
|
|
8
|
-
imageAlt?: string;
|
|
9
|
-
imageBackgroundColor?: string;
|
|
10
7
|
};
|
|
11
8
|
/**
|
|
12
9
|
* Zero-config forgot password page component
|
|
@@ -14,6 +11,6 @@ export type ForgotPasswordPageProps = {
|
|
|
14
11
|
* @param props - Optional configuration overrides
|
|
15
12
|
* @returns Forgot password page component
|
|
16
13
|
*/
|
|
17
|
-
export declare function ForgotPasswordPage({ alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath,
|
|
14
|
+
export declare function ForgotPasswordPage({ alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, }?: ForgotPasswordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
18
15
|
export default ForgotPasswordPage;
|
|
19
16
|
//# sourceMappingURL=forgot_password.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot_password.d.ts","sourceRoot":"","sources":["../../src/page_components/forgot_password.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"forgot_password.d.ts","sourceRoot":"","sources":["../../src/page_components/forgot_password.tsx"],"names":[],"mappings":"AA0BA,MAAM,MAAM,uBAAuB,GAAG;IACpC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,GACrB,GAAE,uBAA4B,2CAgC9B;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -21,10 +21,6 @@ import { useEffect, useState } from "react";
|
|
|
21
21
|
import forgot_password_layout from "../components/layouts/forgot_password/index.js";
|
|
22
22
|
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
23
|
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/forgot_password_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
28
24
|
// section: component
|
|
29
25
|
/**
|
|
30
26
|
* Zero-config forgot password page component
|
|
@@ -32,7 +28,7 @@ const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
|
32
28
|
* @param props - Optional configuration overrides
|
|
33
29
|
* @returns Forgot password page component
|
|
34
30
|
*/
|
|
35
|
-
export function ForgotPasswordPage({ alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/",
|
|
31
|
+
export function ForgotPasswordPage({ alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", } = {}) {
|
|
36
32
|
const [dataClient, setDataClient] = useState(null);
|
|
37
33
|
useEffect(() => {
|
|
38
34
|
// Initialize hazo_connect on client side
|
|
@@ -45,6 +41,6 @@ export function ForgotPasswordPage({ alreadyLoggedInMessage = "You are already l
|
|
|
45
41
|
return (_jsx("div", { className: "cls_forgot_password_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
46
42
|
}
|
|
47
43
|
const ForgotPasswordLayout = forgot_password_layout;
|
|
48
|
-
return (_jsx(ForgotPasswordLayout, {
|
|
44
|
+
return (_jsx(ForgotPasswordLayout, { data_client: dataClient, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath }));
|
|
49
45
|
}
|
|
50
46
|
export default ForgotPasswordPage;
|
|
@@ -15,9 +15,6 @@ export type LoginPageProps = {
|
|
|
15
15
|
createAccountPath?: string;
|
|
16
16
|
createAccountLabel?: string;
|
|
17
17
|
urlOnLogon?: string;
|
|
18
|
-
imageSrc?: string;
|
|
19
|
-
imageAlt?: string;
|
|
20
|
-
imageBackgroundColor?: string;
|
|
21
18
|
};
|
|
22
19
|
/**
|
|
23
20
|
* Zero-config login page component
|
|
@@ -25,6 +22,6 @@ export type LoginPageProps = {
|
|
|
25
22
|
* @param props - Optional configuration overrides
|
|
26
23
|
* @returns Login page component
|
|
27
24
|
*/
|
|
28
|
-
export declare function LoginPage({ redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, urlOnLogon,
|
|
25
|
+
export declare function LoginPage({ redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, urlOnLogon, }?: LoginPageProps): import("react/jsx-runtime").JSX.Element;
|
|
29
26
|
export default LoginPage;
|
|
30
27
|
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/page_components/login.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/page_components/login.tsx"],"names":[],"mappings":"AA0BA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EACxB,aAAa,EACb,cAAyC,EACzC,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,kBAAiD,EACjD,mBAAwC,EACxC,iBAAyC,EACzC,kBAAqC,EACrC,UAAU,GACX,GAAE,cAAmB,2CAuCrB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -21,10 +21,6 @@ import { useEffect, useState } from "react";
|
|
|
21
21
|
import login_layout from "../components/layouts/login/index.js";
|
|
22
22
|
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
23
|
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/login_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
28
24
|
// section: component
|
|
29
25
|
/**
|
|
30
26
|
* Zero-config login page component
|
|
@@ -32,7 +28,7 @@ const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
|
32
28
|
* @param props - Optional configuration overrides
|
|
33
29
|
* @returns Login page component
|
|
34
30
|
*/
|
|
35
|
-
export function LoginPage({ redirectRoute, successMessage = "Successfully logged in", alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", forgotPasswordPath = "/hazo_auth/forgot_password", forgotPasswordLabel = "Forgot password?", createAccountPath = "/hazo_auth/register", createAccountLabel = "Create account", urlOnLogon,
|
|
31
|
+
export function LoginPage({ redirectRoute, successMessage = "Successfully logged in", alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", forgotPasswordPath = "/hazo_auth/forgot_password", forgotPasswordLabel = "Forgot password?", createAccountPath = "/hazo_auth/register", createAccountLabel = "Create account", urlOnLogon, } = {}) {
|
|
36
32
|
const [dataClient, setDataClient] = useState(null);
|
|
37
33
|
useEffect(() => {
|
|
38
34
|
// Initialize hazo_connect on client side
|
|
@@ -45,6 +41,6 @@ export function LoginPage({ redirectRoute, successMessage = "Successfully logged
|
|
|
45
41
|
return (_jsx("div", { className: "cls_login_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
46
42
|
}
|
|
47
43
|
const LoginLayout = login_layout;
|
|
48
|
-
return (_jsx(LoginLayout, {
|
|
44
|
+
return (_jsx(LoginLayout, { data_client: dataClient, redirectRoute: redirectRoute, successMessage: successMessage, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, forgot_password_path: forgotPasswordPath, forgot_password_label: forgotPasswordLabel, create_account_path: createAccountPath, create_account_label: createAccountLabel, urlOnLogon: urlOnLogon }));
|
|
49
45
|
}
|
|
50
46
|
export default LoginPage;
|
|
@@ -10,9 +10,6 @@ export type RegisterPageProps = {
|
|
|
10
10
|
signInPath?: string;
|
|
11
11
|
signInLabel?: string;
|
|
12
12
|
urlOnLogon?: string;
|
|
13
|
-
imageSrc?: string;
|
|
14
|
-
imageAlt?: string;
|
|
15
|
-
imageBackgroundColor?: string;
|
|
16
13
|
};
|
|
17
14
|
/**
|
|
18
15
|
* Zero-config register page component
|
|
@@ -20,6 +17,6 @@ export type RegisterPageProps = {
|
|
|
20
17
|
* @param props - Optional configuration overrides
|
|
21
18
|
* @returns Register page component
|
|
22
19
|
*/
|
|
23
|
-
export declare function RegisterPage({ showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, urlOnLogon,
|
|
20
|
+
export declare function RegisterPage({ showNameField, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, signInPath, signInLabel, urlOnLogon, }?: RegisterPageProps): import("react/jsx-runtime").JSX.Element;
|
|
24
21
|
export default RegisterPage;
|
|
25
22
|
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/page_components/register.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/page_components/register.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AAW7G,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,aAAoB,EACpB,oBAAoD,EACpD,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,UAA+B,EAC/B,WAAuB,EACvB,UAAU,GACX,GAAE,iBAAsB,2CAqCxB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -21,10 +21,6 @@ import { useEffect, useState } from "react";
|
|
|
21
21
|
import register_layout from "../components/layouts/register/index.js";
|
|
22
22
|
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
23
|
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/register_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#e2e8f0";
|
|
28
24
|
const DEFAULT_PASSWORD_REQUIREMENTS = {
|
|
29
25
|
minimum_length: 8,
|
|
30
26
|
require_uppercase: true,
|
|
@@ -39,7 +35,7 @@ const DEFAULT_PASSWORD_REQUIREMENTS = {
|
|
|
39
35
|
* @param props - Optional configuration overrides
|
|
40
36
|
* @returns Register page component
|
|
41
37
|
*/
|
|
42
|
-
export function RegisterPage({ showNameField = true, passwordRequirements = DEFAULT_PASSWORD_REQUIREMENTS, alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", signInPath = "/hazo_auth/login", signInLabel = "Sign in", urlOnLogon,
|
|
38
|
+
export function RegisterPage({ showNameField = true, passwordRequirements = DEFAULT_PASSWORD_REQUIREMENTS, alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", signInPath = "/hazo_auth/login", signInLabel = "Sign in", urlOnLogon, } = {}) {
|
|
43
39
|
const [dataClient, setDataClient] = useState(null);
|
|
44
40
|
useEffect(() => {
|
|
45
41
|
// Initialize hazo_connect on client side
|
|
@@ -52,6 +48,6 @@ export function RegisterPage({ showNameField = true, passwordRequirements = DEFA
|
|
|
52
48
|
return (_jsx("div", { className: "cls_register_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
53
49
|
}
|
|
54
50
|
const RegisterLayout = register_layout;
|
|
55
|
-
return (_jsx(RegisterLayout, {
|
|
51
|
+
return (_jsx(RegisterLayout, { password_requirements: passwordRequirements, show_name_field: showNameField, data_client: dataClient, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, signInPath: signInPath, signInLabel: signInLabel, urlOnLogon: urlOnLogon }));
|
|
56
52
|
}
|
|
57
53
|
export default RegisterPage;
|
|
@@ -10,9 +10,6 @@ export type ResetPasswordPageProps = {
|
|
|
10
10
|
showReturnHomeButton?: boolean;
|
|
11
11
|
returnHomeButtonLabel?: string;
|
|
12
12
|
returnHomePath?: string;
|
|
13
|
-
imageSrc?: string;
|
|
14
|
-
imageAlt?: string;
|
|
15
|
-
imageBackgroundColor?: string;
|
|
16
13
|
};
|
|
17
14
|
/**
|
|
18
15
|
* Zero-config reset password page component
|
|
@@ -20,6 +17,6 @@ export type ResetPasswordPageProps = {
|
|
|
20
17
|
* @param props - Optional configuration overrides
|
|
21
18
|
* @returns Reset password page component
|
|
22
19
|
*/
|
|
23
|
-
export declare function ResetPasswordPage({ errorMessage, successMessage, loginPath, forgotPasswordPath, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath,
|
|
20
|
+
export declare function ResetPasswordPage({ errorMessage, successMessage, loginPath, forgotPasswordPath, passwordRequirements, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, }?: ResetPasswordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
24
21
|
export default ResetPasswordPage;
|
|
25
22
|
//# sourceMappingURL=reset_password.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset_password.d.ts","sourceRoot":"","sources":["../../src/page_components/reset_password.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"reset_password.d.ts","sourceRoot":"","sources":["../../src/page_components/reset_password.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AAW7G,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,YAAmE,EACnE,cAAwF,EACxF,SAA8B,EAC9B,kBAAiD,EACjD,oBAAoD,EACpD,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,GACrB,GAAE,sBAA2B,2CAmC7B;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -21,10 +21,6 @@ import { useEffect, useState } from "react";
|
|
|
21
21
|
import reset_password_layout from "../components/layouts/reset_password/index.js";
|
|
22
22
|
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
23
|
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/reset_password_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
28
24
|
const DEFAULT_PASSWORD_REQUIREMENTS = {
|
|
29
25
|
minimum_length: 8,
|
|
30
26
|
require_uppercase: true,
|
|
@@ -39,7 +35,7 @@ const DEFAULT_PASSWORD_REQUIREMENTS = {
|
|
|
39
35
|
* @param props - Optional configuration overrides
|
|
40
36
|
* @returns Reset password page component
|
|
41
37
|
*/
|
|
42
|
-
export function ResetPasswordPage({ errorMessage = "Your password reset link has expired or is invalid", successMessage = "Password reset successful! You can now log in with your new password.", loginPath = "/hazo_auth/login", forgotPasswordPath = "/hazo_auth/forgot_password", passwordRequirements = DEFAULT_PASSWORD_REQUIREMENTS, alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/",
|
|
38
|
+
export function ResetPasswordPage({ errorMessage = "Your password reset link has expired or is invalid", successMessage = "Password reset successful! You can now log in with your new password.", loginPath = "/hazo_auth/login", forgotPasswordPath = "/hazo_auth/forgot_password", passwordRequirements = DEFAULT_PASSWORD_REQUIREMENTS, alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", } = {}) {
|
|
43
39
|
const [dataClient, setDataClient] = useState(null);
|
|
44
40
|
useEffect(() => {
|
|
45
41
|
// Initialize hazo_connect on client side
|
|
@@ -52,6 +48,6 @@ export function ResetPasswordPage({ errorMessage = "Your password reset link has
|
|
|
52
48
|
return (_jsx("div", { className: "cls_reset_password_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
53
49
|
}
|
|
54
50
|
const ResetPasswordLayout = reset_password_layout;
|
|
55
|
-
return (_jsx(ResetPasswordLayout, {
|
|
51
|
+
return (_jsx(ResetPasswordLayout, { data_client: dataClient, errorMessage: errorMessage, successMessage: successMessage, password_requirements: passwordRequirements, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath }));
|
|
56
52
|
}
|
|
57
53
|
export default ResetPasswordPage;
|
|
@@ -6,9 +6,6 @@ export type VerifyEmailPageProps = {
|
|
|
6
6
|
returnHomePath?: string;
|
|
7
7
|
redirectDelay?: number;
|
|
8
8
|
loginPath?: string;
|
|
9
|
-
imageSrc?: string;
|
|
10
|
-
imageAlt?: string;
|
|
11
|
-
imageBackgroundColor?: string;
|
|
12
9
|
};
|
|
13
10
|
/**
|
|
14
11
|
* Zero-config verify email page component
|
|
@@ -16,6 +13,6 @@ export type VerifyEmailPageProps = {
|
|
|
16
13
|
* @param props - Optional configuration overrides
|
|
17
14
|
* @returns Verify email page component
|
|
18
15
|
*/
|
|
19
|
-
export declare function VerifyEmailPage({ alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, redirectDelay, loginPath,
|
|
16
|
+
export declare function VerifyEmailPage({ alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, redirectDelay, loginPath, }?: VerifyEmailPageProps): import("react/jsx-runtime").JSX.Element;
|
|
20
17
|
export default VerifyEmailPage;
|
|
21
18
|
//# sourceMappingURL=verify_email.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify_email.d.ts","sourceRoot":"","sources":["../../src/page_components/verify_email.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verify_email.d.ts","sourceRoot":"","sources":["../../src/page_components/verify_email.tsx"],"names":[],"mappings":"AA0BA,MAAM,MAAM,oBAAoB,GAAG;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,aAAoB,EACpB,SAA8B,GAC/B,GAAE,oBAAyB,2CAkC3B;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -21,10 +21,6 @@ import { useEffect, useState } from "react";
|
|
|
21
21
|
import email_verification_layout from "../components/layouts/email_verification/index.js";
|
|
22
22
|
import { createLayoutDataClient } from "../components/layouts/shared/data/layout_data_client.js";
|
|
23
23
|
import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
24
|
-
// section: constants
|
|
25
|
-
const DEFAULT_IMAGE_SRC = "/hazo_auth/images/verify_email_default.jpg";
|
|
26
|
-
const DEFAULT_IMAGE_ALT = "Illustration of a globe representing secure authentication workflows";
|
|
27
|
-
const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
28
24
|
// section: component
|
|
29
25
|
/**
|
|
30
26
|
* Zero-config verify email page component
|
|
@@ -32,7 +28,7 @@ const DEFAULT_IMAGE_BG = "#f1f5f9";
|
|
|
32
28
|
* @param props - Optional configuration overrides
|
|
33
29
|
* @returns Verify email page component
|
|
34
30
|
*/
|
|
35
|
-
export function VerifyEmailPage({ alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", redirectDelay = 3000, loginPath = "/hazo_auth/login",
|
|
31
|
+
export function VerifyEmailPage({ alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", redirectDelay = 3000, loginPath = "/hazo_auth/login", } = {}) {
|
|
36
32
|
const [dataClient, setDataClient] = useState(null);
|
|
37
33
|
useEffect(() => {
|
|
38
34
|
// Initialize hazo_connect on client side
|
|
@@ -45,6 +41,6 @@ export function VerifyEmailPage({ alreadyLoggedInMessage = "You are already logg
|
|
|
45
41
|
return (_jsx("div", { className: "cls_verify_email_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: "Loading..." }) }));
|
|
46
42
|
}
|
|
47
43
|
const EmailVerificationLayout = email_verification_layout;
|
|
48
|
-
return (_jsx(EmailVerificationLayout, {
|
|
44
|
+
return (_jsx(EmailVerificationLayout, { data_client: dataClient, already_logged_in_message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, redirect_delay: redirectDelay, login_path: loginPath }));
|
|
49
45
|
}
|
|
50
46
|
export default VerifyEmailPage;
|
|
@@ -28,6 +28,7 @@ export { GET as invitationsGET, POST as invitationsPOST, PATCH as invitationsPAT
|
|
|
28
28
|
export { POST as createFirmPOST } from "./create_firm.js";
|
|
29
29
|
export { GET as nextauthGET, POST as nextauthPOST } from "./nextauth.js";
|
|
30
30
|
export { GET as oauthGoogleCallbackGET } from "./oauth_google_callback.js";
|
|
31
|
+
export { facebookCallbackGET } from "./oauth_facebook_callback.js";
|
|
31
32
|
export { POST as setPasswordPOST } from "./set_password.js";
|
|
32
33
|
export { GET as relationshipsGET, POST as relationshipsPOST, PATCH as relationshipsPATCH, DELETE as relationshipsDELETE } from "./relationships.js";
|
|
33
34
|
export { POST as relationshipSelfPOST } from "./relationship_self.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/routes/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,IAAI,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,GAAG,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,EAAE,GAAG,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,IAAI,IAAI,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGvE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,IAAI,IAAI,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,MA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,KAAK,IAAI,gBAAgB,EAAE,GAAG,IAAI,cAAc,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvI,OAAO,EAAE,GAAG,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGrE,OAAO,EAAE,GAAG,IAAI,cAAc,EAAE,IAAI,IAAI,eAAe,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvI,OAAO,EAAE,IAAI,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EAAE,GAAG,IAAI,WAAW,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,GAAG,IAAI,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,EAAE,GAAG,IAAI,gBAAgB,EAAE,IAAI,IAAI,iBAAiB,EAAE,KAAK,IAAI,kBAAkB,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACjJ,OAAO,EAAE,IAAI,IAAI,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -41,6 +41,7 @@ export { POST as createFirmPOST } from "./create_firm.js";
|
|
|
41
41
|
// OAuth routes
|
|
42
42
|
export { GET as nextauthGET, POST as nextauthPOST } from "./nextauth.js";
|
|
43
43
|
export { GET as oauthGoogleCallbackGET } from "./oauth_google_callback.js";
|
|
44
|
+
export { facebookCallbackGET } from "./oauth_facebook_callback.js";
|
|
44
45
|
export { POST as setPasswordPOST } from "./set_password.js";
|
|
45
46
|
// Relationship routes (managed sub-profiles)
|
|
46
47
|
export { GET as relationshipsGET, POST as relationshipsPOST, PATCH as relationshipsPATCH, DELETE as relationshipsDELETE } from "./relationships.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
2
|
+
/**
|
|
3
|
+
* Handles the OAuth callback after Facebook sign-in
|
|
4
|
+
* The user creation/linking is done in NextAuth signIn callback
|
|
5
|
+
* This route just sets the hazo_auth session cookies
|
|
6
|
+
*/
|
|
7
|
+
export declare function facebookCallbackGET(original_request: NextRequest): Promise<NextResponse<unknown>>;
|
|
8
|
+
//# sourceMappingURL=oauth_facebook_callback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth_facebook_callback.d.ts","sourceRoot":"","sources":["../../../src/server/routes/oauth_facebook_callback.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAuBxD;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,gBAAgB,EAAE,WAAW,kCAoKtE"}
|