hazo_auth 1.4.0 → 1.4.2
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 +41 -38
- package/dist/components/layouts/email_verification/config/email_verification_field_config.d.ts +2 -2
- package/dist/components/layouts/email_verification/config/email_verification_field_config.d.ts.map +1 -1
- package/dist/components/layouts/email_verification/config/email_verification_field_config.js +1 -1
- package/dist/components/layouts/email_verification/hooks/use_email_verification.d.ts +2 -2
- package/dist/components/layouts/email_verification/hooks/use_email_verification.d.ts.map +1 -1
- package/dist/components/layouts/email_verification/hooks/use_email_verification.js +2 -2
- package/dist/components/layouts/email_verification/index.d.ts +3 -3
- package/dist/components/layouts/email_verification/index.d.ts.map +1 -1
- package/dist/components/layouts/email_verification/index.js +9 -9
- package/dist/components/layouts/forgot_password/config/forgot_password_field_config.d.ts +2 -2
- package/dist/components/layouts/forgot_password/config/forgot_password_field_config.d.ts.map +1 -1
- package/dist/components/layouts/forgot_password/config/forgot_password_field_config.js +1 -1
- package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.d.ts +2 -2
- package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.d.ts.map +1 -1
- package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.js +2 -2
- package/dist/components/layouts/forgot_password/index.d.ts +2 -2
- package/dist/components/layouts/forgot_password/index.d.ts.map +1 -1
- package/dist/components/layouts/forgot_password/index.js +8 -8
- package/dist/components/layouts/login/config/login_field_config.d.ts +2 -2
- package/dist/components/layouts/login/config/login_field_config.d.ts.map +1 -1
- package/dist/components/layouts/login/config/login_field_config.js +1 -1
- package/dist/components/layouts/login/hooks/use_login_form.d.ts +2 -2
- package/dist/components/layouts/login/hooks/use_login_form.d.ts.map +1 -1
- package/dist/components/layouts/login/hooks/use_login_form.js +4 -4
- package/dist/components/layouts/login/index.d.ts +2 -2
- package/dist/components/layouts/login/index.d.ts.map +1 -1
- package/dist/components/layouts/login/index.js +9 -9
- package/dist/components/layouts/my_settings/components/editable_field.js +3 -3
- package/dist/components/layouts/my_settings/components/password_change_dialog.d.ts +1 -1
- package/dist/components/layouts/my_settings/components/password_change_dialog.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/components/password_change_dialog.js +4 -4
- package/dist/components/layouts/my_settings/components/profile_picture_dialog.js +7 -7
- package/dist/components/layouts/my_settings/components/profile_picture_display.js +1 -1
- package/dist/components/layouts/my_settings/components/profile_picture_gravatar_tab.js +3 -3
- package/dist/components/layouts/my_settings/components/profile_picture_library_tab.js +5 -5
- package/dist/components/layouts/my_settings/components/profile_picture_upload_tab.js +4 -4
- package/dist/components/layouts/my_settings/config/my_settings_field_config.d.ts +1 -1
- package/dist/components/layouts/my_settings/config/my_settings_field_config.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/config/my_settings_field_config.js +1 -1
- package/dist/components/layouts/my_settings/hooks/use_my_settings.d.ts +1 -1
- 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 +1 -1
- package/dist/components/layouts/my_settings/index.d.ts +2 -2
- package/dist/components/layouts/my_settings/index.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/index.js +9 -9
- package/dist/components/layouts/register/config/register_field_config.d.ts +2 -2
- package/dist/components/layouts/register/config/register_field_config.d.ts.map +1 -1
- package/dist/components/layouts/register/config/register_field_config.js +1 -1
- package/dist/components/layouts/register/hooks/use_register_form.d.ts +3 -3
- package/dist/components/layouts/register/hooks/use_register_form.d.ts.map +1 -1
- package/dist/components/layouts/register/hooks/use_register_form.js +2 -2
- package/dist/components/layouts/register/index.d.ts +2 -2
- package/dist/components/layouts/register/index.d.ts.map +1 -1
- package/dist/components/layouts/register/index.js +9 -9
- package/dist/components/layouts/reset_password/config/reset_password_field_config.d.ts +2 -2
- package/dist/components/layouts/reset_password/config/reset_password_field_config.d.ts.map +1 -1
- package/dist/components/layouts/reset_password/config/reset_password_field_config.js +1 -1
- package/dist/components/layouts/reset_password/hooks/use_reset_password_form.d.ts +3 -3
- package/dist/components/layouts/reset_password/hooks/use_reset_password_form.d.ts.map +1 -1
- package/dist/components/layouts/reset_password/hooks/use_reset_password_form.js +2 -2
- package/dist/components/layouts/reset_password/index.d.ts +2 -2
- package/dist/components/layouts/reset_password/index.d.ts.map +1 -1
- package/dist/components/layouts/reset_password/index.js +8 -8
- package/dist/components/layouts/shared/components/already_logged_in_guard.js +4 -4
- package/dist/components/layouts/shared/components/auth_page_shell.js +3 -3
- package/dist/components/layouts/shared/components/form_action_buttons.d.ts +1 -1
- package/dist/components/layouts/shared/components/form_action_buttons.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/form_action_buttons.js +1 -1
- package/dist/components/layouts/shared/components/form_field_wrapper.js +2 -2
- package/dist/components/layouts/shared/components/logout_button.js +2 -2
- package/dist/components/layouts/shared/components/password_field.js +3 -3
- package/dist/components/layouts/shared/components/profile_pic_menu.d.ts +1 -1
- package/dist/components/layouts/shared/components/profile_pic_menu.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/profile_pic_menu.js +4 -4
- package/dist/components/layouts/shared/components/profile_pic_menu_wrapper.js +2 -2
- package/dist/components/layouts/shared/components/sidebar_layout_wrapper.js +3 -3
- package/dist/components/layouts/shared/components/standalone_layout_wrapper.js +1 -1
- package/dist/components/layouts/shared/components/two_column_auth_layout.js +1 -1
- package/dist/components/layouts/shared/components/unauthorized_guard.js +2 -2
- package/dist/components/layouts/shared/hooks/use_hazo_auth.d.ts +1 -1
- package/dist/components/layouts/shared/hooks/use_hazo_auth.d.ts.map +1 -1
- package/dist/components/layouts/shared/utils/validation.d.ts +1 -1
- package/dist/components/layouts/shared/utils/validation.d.ts.map +1 -1
- package/dist/components/layouts/user_management/components/roles_matrix.js +7 -7
- package/dist/components/layouts/user_management/index.js +11 -11
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/hazo_ui_tooltip.js +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +8 -8
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/table.js +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/ui/vertical-tabs.js +1 -1
- package/dist/lib/already_logged_in_config.server.js +1 -1
- package/dist/lib/app_logger.js +1 -1
- package/dist/lib/auth/auth_cache.d.ts +1 -1
- package/dist/lib/auth/auth_cache.d.ts.map +1 -1
- package/dist/lib/auth/auth_utils.server.js +2 -2
- package/dist/lib/auth/hazo_get_auth.server.d.ts +1 -1
- package/dist/lib/auth/hazo_get_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.js +7 -7
- package/dist/lib/auth/server_auth.js +2 -2
- package/dist/lib/auth_utility_config.server.js +1 -1
- package/dist/lib/config/config_loader.server.js +1 -1
- package/dist/lib/email_verification_config.server.js +1 -1
- package/dist/lib/file_types_config.server.js +1 -1
- package/dist/lib/forgot_password_config.server.js +1 -1
- package/dist/lib/hazo_connect_instance.server.js +2 -2
- package/dist/lib/hazo_connect_setup.server.js +2 -2
- package/dist/lib/login_config.server.js +2 -2
- package/dist/lib/messages_config.server.js +1 -1
- package/dist/lib/my_settings_config.server.js +7 -7
- package/dist/lib/password_requirements_config.server.js +1 -1
- package/dist/lib/profile_pic_menu_config.server.js +1 -1
- package/dist/lib/profile_picture_config.server.js +2 -2
- package/dist/lib/register_config.server.js +4 -4
- package/dist/lib/reset_password_config.server.js +3 -3
- package/dist/lib/services/email_service.js +2 -2
- package/dist/lib/services/email_verification_service.js +3 -3
- package/dist/lib/services/login_service.js +3 -3
- package/dist/lib/services/password_change_service.js +3 -3
- package/dist/lib/services/password_reset_service.js +3 -3
- package/dist/lib/services/profile_picture_remove_service.js +3 -3
- package/dist/lib/services/profile_picture_service.d.ts +1 -1
- package/dist/lib/services/profile_picture_service.d.ts.map +1 -1
- package/dist/lib/services/profile_picture_service.js +5 -5
- package/dist/lib/services/registration_service.js +8 -8
- package/dist/lib/services/token_service.js +2 -2
- package/dist/lib/services/user_profiles_service.js +2 -2
- package/dist/lib/services/user_update_service.d.ts +1 -1
- package/dist/lib/services/user_update_service.d.ts.map +1 -1
- package/dist/lib/services/user_update_service.js +4 -4
- package/dist/lib/ui_shell_config.server.js +1 -1
- package/dist/lib/ui_sizes_config.server.js +1 -1
- package/dist/lib/user_fields_config.server.js +1 -1
- package/dist/lib/user_management_config.server.js +1 -1
- package/dist/lib/utils/error_sanitizer.d.ts +1 -1
- package/dist/lib/utils/error_sanitizer.d.ts.map +1 -1
- package/dist/server/config/config_loader.d.ts +1 -1
- package/dist/server/config/config_loader.d.ts.map +1 -1
- package/dist/server/config/config_loader.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/logging/logger_service.d.ts +1 -1
- package/dist/server/logging/logger_service.d.ts.map +1 -1
- package/dist/server/server.js +2 -2
- package/package.json +35 -19
- package/src/components/layouts/email_verification/config/email_verification_field_config.ts +2 -2
- package/src/components/layouts/email_verification/hooks/use_email_verification.ts +3 -3
- package/src/components/layouts/email_verification/index.tsx +11 -11
- package/src/components/layouts/forgot_password/config/forgot_password_field_config.ts +2 -2
- package/src/components/layouts/forgot_password/hooks/use_forgot_password_form.ts +3 -3
- package/src/components/layouts/forgot_password/index.tsx +10 -10
- package/src/components/layouts/login/config/login_field_config.ts +2 -2
- package/src/components/layouts/login/hooks/use_login_form.ts +5 -5
- package/src/components/layouts/login/index.tsx +11 -11
- package/src/components/layouts/my_settings/components/editable_field.tsx +3 -3
- package/src/components/layouts/my_settings/components/password_change_dialog.tsx +5 -5
- package/src/components/layouts/my_settings/components/profile_picture_dialog.tsx +7 -7
- package/src/components/layouts/my_settings/components/profile_picture_display.tsx +2 -2
- package/src/components/layouts/my_settings/components/profile_picture_gravatar_tab.tsx +3 -3
- package/src/components/layouts/my_settings/components/profile_picture_library_tab.tsx +5 -5
- package/src/components/layouts/my_settings/components/profile_picture_upload_tab.tsx +4 -4
- package/src/components/layouts/my_settings/config/my_settings_field_config.ts +2 -2
- package/src/components/layouts/my_settings/hooks/use_my_settings.ts +2 -2
- package/src/components/layouts/my_settings/index.tsx +10 -10
- package/src/components/layouts/register/config/register_field_config.ts +2 -2
- package/src/components/layouts/register/hooks/use_register_form.ts +4 -4
- package/src/components/layouts/register/index.tsx +11 -11
- package/src/components/layouts/reset_password/config/reset_password_field_config.ts +2 -2
- package/src/components/layouts/reset_password/hooks/use_reset_password_form.ts +4 -4
- package/src/components/layouts/reset_password/index.tsx +10 -10
- package/src/components/layouts/shared/components/already_logged_in_guard.tsx +4 -4
- package/src/components/layouts/shared/components/auth_page_shell.tsx +3 -3
- package/src/components/layouts/shared/components/form_action_buttons.tsx +2 -2
- package/src/components/layouts/shared/components/form_field_wrapper.tsx +2 -2
- package/src/components/layouts/shared/components/logout_button.tsx +2 -2
- package/src/components/layouts/shared/components/password_field.tsx +3 -3
- package/src/components/layouts/shared/components/profile_pic_menu.tsx +5 -5
- package/src/components/layouts/shared/components/profile_pic_menu_wrapper.tsx +2 -2
- package/src/components/layouts/shared/components/sidebar_layout_wrapper.tsx +3 -3
- package/src/components/layouts/shared/components/standalone_layout_wrapper.tsx +1 -1
- package/src/components/layouts/shared/components/two_column_auth_layout.tsx +1 -1
- package/src/components/layouts/shared/components/unauthorized_guard.tsx +2 -2
- package/src/components/layouts/shared/hooks/use_hazo_auth.ts +1 -1
- package/src/components/layouts/shared/utils/validation.ts +1 -1
- package/src/components/layouts/user_management/components/roles_matrix.tsx +7 -7
- package/src/components/layouts/user_management/index.tsx +11 -11
- package/src/components/ui/alert-dialog.tsx +2 -2
- package/src/components/ui/avatar.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/dialog.tsx +1 -1
- package/src/components/ui/dropdown-menu.tsx +1 -1
- package/src/components/ui/hazo_ui_tooltip.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +1 -1
- package/src/components/ui/sidebar.tsx +8 -8
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/switch.tsx +1 -1
- package/src/components/ui/table.tsx +1 -1
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/components/ui/vertical-tabs.tsx +1 -1
- package/src/lib/already_logged_in_config.server.ts +1 -1
- package/src/lib/app_logger.ts +1 -1
- package/src/lib/auth/auth_cache.ts +1 -1
- package/src/lib/auth/auth_utils.server.ts +2 -2
- package/src/lib/auth/hazo_get_auth.server.ts +8 -8
- package/src/lib/auth/server_auth.ts +2 -2
- package/src/lib/auth_utility_config.server.ts +1 -1
- package/src/lib/config/config_loader.server.ts +1 -1
- package/src/lib/email_verification_config.server.ts +1 -1
- package/src/lib/file_types_config.server.ts +1 -1
- package/src/lib/forgot_password_config.server.ts +1 -1
- package/src/lib/hazo_connect_instance.server.ts +2 -2
- package/src/lib/hazo_connect_setup.server.ts +2 -2
- package/src/lib/login_config.server.ts +2 -2
- package/src/lib/messages_config.server.ts +1 -1
- package/src/lib/my_settings_config.server.ts +7 -7
- package/src/lib/password_requirements_config.server.ts +1 -1
- package/src/lib/profile_pic_menu_config.server.ts +1 -1
- package/src/lib/profile_picture_config.server.ts +2 -2
- package/src/lib/register_config.server.ts +4 -4
- package/src/lib/reset_password_config.server.ts +3 -3
- package/src/lib/services/email_service.ts +2 -2
- package/src/lib/services/email_verification_service.ts +3 -3
- package/src/lib/services/login_service.ts +3 -3
- package/src/lib/services/password_change_service.ts +3 -3
- package/src/lib/services/password_reset_service.ts +3 -3
- package/src/lib/services/profile_picture_remove_service.ts +3 -3
- package/src/lib/services/profile_picture_service.ts +5 -5
- package/src/lib/services/registration_service.ts +8 -8
- package/src/lib/services/token_service.ts +2 -2
- package/src/lib/services/user_profiles_service.ts +2 -2
- package/src/lib/services/user_update_service.ts +4 -4
- package/src/lib/ui_shell_config.server.ts +1 -1
- package/src/lib/ui_sizes_config.server.ts +1 -1
- package/src/lib/user_fields_config.server.ts +1 -1
- package/src/lib/user_management_config.server.ts +1 -1
- package/src/lib/utils/error_sanitizer.ts +1 -1
- package/src/routes/index.ts +4 -4
- package/src/server/config/config_loader.ts +2 -2
- package/src/server/index.ts +2 -2
- package/src/server/logging/logger_service.ts +1 -1
- package/src/server/server.ts +2 -2
- package/src/server/types/express.d.ts +1 -1
- package/tsconfig.build.json +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createCrudService } from "hazo_connect/server";
|
|
2
|
-
import { create_token } from "
|
|
2
|
+
import { create_token } from "./token_service";
|
|
3
3
|
import argon2 from "argon2";
|
|
4
|
-
import { create_app_logger } from "
|
|
5
|
-
import { send_template_email } from "
|
|
4
|
+
import { create_app_logger } from "../app_logger";
|
|
5
|
+
import { send_template_email } from "./email_service";
|
|
6
6
|
// section: helpers
|
|
7
7
|
/**
|
|
8
8
|
* Requests a password reset for a user by email
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCrudService } from "hazo_connect/server";
|
|
2
|
-
import { map_db_source_to_ui } from "
|
|
3
|
-
import { get_profile_picture_config } from "
|
|
4
|
-
import { create_app_logger } from "
|
|
2
|
+
import { map_db_source_to_ui } from "./profile_picture_source_mapper";
|
|
3
|
+
import { get_profile_picture_config } from "../profile_picture_config.server";
|
|
4
|
+
import { create_app_logger } from "../app_logger";
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import path from "path";
|
|
7
7
|
// section: helpers
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HazoConnectAdapter } from "hazo_connect";
|
|
2
|
-
import { type ProfilePictureSourceUI } from "
|
|
2
|
+
import { type ProfilePictureSourceUI } from "./profile_picture_source_mapper";
|
|
3
3
|
export type ProfilePictureSource = ProfilePictureSourceUI;
|
|
4
4
|
export type DefaultProfilePictureResult = {
|
|
5
5
|
profile_picture_url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile_picture_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/profile_picture_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AASvD,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"profile_picture_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/profile_picture_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AASvD,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGnG,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D,MAAM,MAAM,2BAA2B,GAAG;IACxC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,oBAAoB,CAAC;CACtC,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAOrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAyBjD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAiC7D;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,2BAA2B,GAAG,IAAI,CA2DpC;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,MAAM,EAC3B,cAAc,EAAE,oBAAoB,GACnC,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAsB/C"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createCrudService } from "hazo_connect/server";
|
|
2
2
|
import gravatarUrl from "gravatar-url";
|
|
3
|
-
import { get_profile_picture_config } from "
|
|
4
|
-
import { get_ui_sizes_config } from "
|
|
5
|
-
import { get_file_types_config } from "
|
|
6
|
-
import { create_app_logger } from "
|
|
3
|
+
import { get_profile_picture_config } from "../profile_picture_config.server";
|
|
4
|
+
import { get_ui_sizes_config } from "../ui_sizes_config.server";
|
|
5
|
+
import { get_file_types_config } from "../file_types_config.server";
|
|
6
|
+
import { create_app_logger } from "../app_logger";
|
|
7
7
|
import path from "path";
|
|
8
8
|
import fs from "fs";
|
|
9
|
-
import { map_ui_source_to_db } from "
|
|
9
|
+
import { map_ui_source_to_db } from "./profile_picture_source_mapper";
|
|
10
10
|
// section: helpers
|
|
11
11
|
/**
|
|
12
12
|
* Generates Gravatar URL from email address
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createCrudService } from "hazo_connect/server";
|
|
2
2
|
import argon2 from "argon2";
|
|
3
3
|
import { randomUUID } from "crypto";
|
|
4
|
-
import { create_token } from "
|
|
5
|
-
import { get_default_profile_picture } from "
|
|
6
|
-
import { get_profile_picture_config } from "
|
|
7
|
-
import { map_ui_source_to_db } from "
|
|
8
|
-
import { create_app_logger } from "
|
|
9
|
-
import { send_template_email } from "
|
|
10
|
-
import { sanitize_error_for_user } from "
|
|
11
|
-
import { get_line_number } from "
|
|
4
|
+
import { create_token } from "./token_service";
|
|
5
|
+
import { get_default_profile_picture } from "./profile_picture_service";
|
|
6
|
+
import { get_profile_picture_config } from "../profile_picture_config.server";
|
|
7
|
+
import { map_ui_source_to_db } from "./profile_picture_source_mapper";
|
|
8
|
+
import { create_app_logger } from "../app_logger";
|
|
9
|
+
import { send_template_email } from "./email_service";
|
|
10
|
+
import { sanitize_error_for_user } from "../utils/error_sanitizer";
|
|
11
|
+
import { get_line_number } from "../utils/api_route_helpers";
|
|
12
12
|
// section: helpers
|
|
13
13
|
/**
|
|
14
14
|
* Registers a new user in the database using hazo_connect
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createCrudService } from "hazo_connect/server";
|
|
2
2
|
import { randomBytes, randomUUID } from "crypto";
|
|
3
3
|
import argon2 from "argon2";
|
|
4
|
-
import { read_config_section } from "
|
|
5
|
-
import { create_app_logger } from "
|
|
4
|
+
import { read_config_section } from "../config/config_loader.server";
|
|
5
|
+
import { create_app_logger } from "../app_logger";
|
|
6
6
|
// section: helpers
|
|
7
7
|
/**
|
|
8
8
|
* Gets token expiry hours from hazo_auth_config.ini for a specific token type
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCrudService } from "hazo_connect/server";
|
|
2
2
|
import { differenceInDays } from "date-fns";
|
|
3
|
-
import { create_app_logger } from "
|
|
4
|
-
import { sanitize_error_for_user } from "
|
|
3
|
+
import { create_app_logger } from "../app_logger";
|
|
4
|
+
import { sanitize_error_for_user } from "../utils/error_sanitizer";
|
|
5
5
|
// section: helpers
|
|
6
6
|
/**
|
|
7
7
|
* Retrieves basic profile information for multiple users in a single batch call
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HazoConnectAdapter } from "hazo_connect";
|
|
2
|
-
import { type ProfilePictureSourceUI } from "
|
|
2
|
+
import { type ProfilePictureSourceUI } from "./profile_picture_source_mapper";
|
|
3
3
|
export type UserUpdateData = {
|
|
4
4
|
name?: string;
|
|
5
5
|
email?: string;
|
|
@@ -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,
|
|
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;CACzC,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,CAuG3B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createCrudService } from "hazo_connect/server";
|
|
2
|
-
import { map_ui_source_to_db } from "
|
|
3
|
-
import { create_app_logger } from "
|
|
4
|
-
import { sanitize_error_for_user } from "
|
|
5
|
-
import { get_line_number } from "
|
|
2
|
+
import { map_ui_source_to_db } from "./profile_picture_source_mapper";
|
|
3
|
+
import { create_app_logger } from "../app_logger";
|
|
4
|
+
import { sanitize_error_for_user } from "../utils/error_sanitizer";
|
|
5
|
+
import { get_line_number } from "../utils/api_route_helpers";
|
|
6
6
|
// section: helpers
|
|
7
7
|
/**
|
|
8
8
|
* Updates user profile information (name, email)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// file_description: load ui shell layout settings from hazo_auth_config.ini
|
|
2
2
|
// section: imports
|
|
3
|
-
import { get_config_value } from "
|
|
3
|
+
import { get_config_value } from "./config/config_loader.server";
|
|
4
4
|
// section: helpers
|
|
5
5
|
/**
|
|
6
6
|
* Reads ui shell configuration controlling whether pages use the sidebar test shell
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// file_description: server-only helper to read UI size configuration from hazo_auth_config.ini
|
|
2
2
|
// section: imports
|
|
3
|
-
import { get_config_number } from "
|
|
3
|
+
import { get_config_number } from "./config/config_loader.server";
|
|
4
4
|
// section: helpers
|
|
5
5
|
/**
|
|
6
6
|
* Reads UI size configuration from hazo_auth_config.ini file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// file_description: server-only helper to read shared user fields configuration from hazo_auth_config.ini
|
|
2
2
|
// section: imports
|
|
3
|
-
import { get_config_boolean } from "
|
|
3
|
+
import { get_config_boolean } from "./config/config_loader.server";
|
|
4
4
|
// section: helpers
|
|
5
5
|
/**
|
|
6
6
|
* Reads shared user fields configuration from hazo_auth_config.ini file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// file_description: server-only helper to read user management configuration from hazo_auth_config.ini
|
|
2
2
|
// section: imports
|
|
3
|
-
import { get_config_array, read_config_section } from "
|
|
3
|
+
import { get_config_array, read_config_section } from "./config/config_loader.server";
|
|
4
4
|
// section: helpers
|
|
5
5
|
/**
|
|
6
6
|
* Reads user management configuration from hazo_auth_config.ini file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error_sanitizer.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/error_sanitizer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"error_sanitizer.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/error_sanitizer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMlD,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAGF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,wBAA6B,GACrC,MAAM,CA8CR"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { app_context, captcha_settings, logger_service, password_policy, rate_limit_settings, runtime_configuration, token_settings } from "
|
|
1
|
+
import type { app_context, captcha_settings, logger_service, password_policy, rate_limit_settings, runtime_configuration, token_settings } from "../types/app_types";
|
|
2
2
|
type direct_configuration_input = {
|
|
3
3
|
permission_names?: string[];
|
|
4
4
|
templates?: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config_loader.d.ts","sourceRoot":"","sources":["../../../src/server/config/config_loader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACf,MAAM,
|
|
1
|
+
{"version":3,"file":"config_loader.d.ts","sourceRoot":"","sources":["../../../src/server/config/config_loader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAG5B,KAAK,0BAA0B,GAAG;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;CACnD,CAAC;AAkGF,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAyQF,eAAO,MAAM,0BAA0B,GACrC,UAAU,qBAAqB,KAC9B,qBAsFF,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAAI,UAAU,qBAAqB,KAAG,WAEnE,CAAC"}
|
|
@@ -4,7 +4,7 @@ import fs from "fs";
|
|
|
4
4
|
import path from "path";
|
|
5
5
|
import axios from "axios";
|
|
6
6
|
import { HazoConfig } from "hazo_config/dist/lib";
|
|
7
|
-
import { create_logger_service } from "
|
|
7
|
+
import { create_logger_service } from "../logging/logger_service";
|
|
8
8
|
const is_string_record = (value) => !!value &&
|
|
9
9
|
typeof value === "object" &&
|
|
10
10
|
!Array.isArray(value) &&
|
package/dist/server/index.js
CHANGED
|
@@ -2,8 +2,8 @@ var _a;
|
|
|
2
2
|
// file_description: bootstrap entry point for the hazo_auth express server
|
|
3
3
|
// section: imports
|
|
4
4
|
import http from "http";
|
|
5
|
-
import { create_server_app } from "
|
|
6
|
-
import { create_logger_service } from "
|
|
5
|
+
import { create_server_app } from "./server";
|
|
6
|
+
import { create_logger_service } from "./logging/logger_service";
|
|
7
7
|
// section: constants
|
|
8
8
|
const default_port = Number((_a = process.env.PORT) !== null && _a !== void 0 ? _a : 4100);
|
|
9
9
|
const server_namespace = "hazo_auth_server";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { logger_service } from "
|
|
1
|
+
import type { logger_service } from "../types/app_types";
|
|
2
2
|
export declare const create_logger_service: (namespace: string, external_logger?: Partial<logger_service>) => logger_service;
|
|
3
3
|
//# sourceMappingURL=logger_service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger_service.d.ts","sourceRoot":"","sources":["../../../src/server/logging/logger_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"logger_service.d.ts","sourceRoot":"","sources":["../../../src/server/logging/logger_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA2BxE,eAAO,MAAM,qBAAqB,GAChC,WAAW,MAAM,EACjB,kBAAkB,OAAO,CAAC,cAAc,CAAC,KACxC,cAsBF,CAAC"}
|
package/dist/server/server.js
CHANGED
|
@@ -5,8 +5,8 @@ import helmet from "helmet";
|
|
|
5
5
|
import cors from "cors";
|
|
6
6
|
import cookie_parser from "cookie-parser";
|
|
7
7
|
import compression from "compression";
|
|
8
|
-
import { create_root_router } from "
|
|
9
|
-
import { create_app_context } from "
|
|
8
|
+
import { create_root_router } from "./routes/root_router";
|
|
9
|
+
import { create_app_context } from "./config/config_loader";
|
|
10
10
|
// section: app_factory
|
|
11
11
|
export const create_server_app = () => {
|
|
12
12
|
const server_app = express();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_auth",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -9,29 +9,45 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"import": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
-
"./components
|
|
13
|
-
"types": "./dist/components
|
|
14
|
-
"import": "./dist/components
|
|
12
|
+
"./components/layouts/login": {
|
|
13
|
+
"types": "./dist/components/layouts/login/index.d.ts",
|
|
14
|
+
"import": "./dist/components/layouts/login/index.js"
|
|
15
15
|
},
|
|
16
|
-
"./components/
|
|
17
|
-
"types": "./dist/components/
|
|
18
|
-
"import": "./dist/components/
|
|
16
|
+
"./components/layouts/register": {
|
|
17
|
+
"types": "./dist/components/layouts/register/index.d.ts",
|
|
18
|
+
"import": "./dist/components/layouts/register/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./components/layouts
|
|
21
|
-
"types": "./dist/components/layouts
|
|
22
|
-
"import": "./dist/components/layouts
|
|
20
|
+
"./components/layouts/forgot_password": {
|
|
21
|
+
"types": "./dist/components/layouts/forgot_password/index.d.ts",
|
|
22
|
+
"import": "./dist/components/layouts/forgot_password/index.js"
|
|
23
23
|
},
|
|
24
|
-
"./
|
|
25
|
-
"types": "./dist/
|
|
26
|
-
"import": "./dist/
|
|
24
|
+
"./components/layouts/reset_password": {
|
|
25
|
+
"types": "./dist/components/layouts/reset_password/index.d.ts",
|
|
26
|
+
"import": "./dist/components/layouts/reset_password/index.js"
|
|
27
27
|
},
|
|
28
|
-
"./
|
|
29
|
-
"types": "./dist/
|
|
30
|
-
"import": "./dist/
|
|
28
|
+
"./components/layouts/email_verification": {
|
|
29
|
+
"types": "./dist/components/layouts/email_verification/index.d.ts",
|
|
30
|
+
"import": "./dist/components/layouts/email_verification/index.js"
|
|
31
31
|
},
|
|
32
|
-
"./
|
|
33
|
-
"types": "./dist/
|
|
34
|
-
"import": "./dist/
|
|
32
|
+
"./components/layouts/my_settings": {
|
|
33
|
+
"types": "./dist/components/layouts/my_settings/index.d.ts",
|
|
34
|
+
"import": "./dist/components/layouts/my_settings/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./components/layouts/user_management": {
|
|
37
|
+
"types": "./dist/components/layouts/user_management/index.d.ts",
|
|
38
|
+
"import": "./dist/components/layouts/user_management/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./components/layouts/shared": {
|
|
41
|
+
"types": "./dist/components/layouts/shared/index.d.ts",
|
|
42
|
+
"import": "./dist/components/layouts/shared/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./lib/auth/hazo_get_auth.server": {
|
|
45
|
+
"types": "./dist/lib/auth/hazo_get_auth.server.d.ts",
|
|
46
|
+
"import": "./dist/lib/auth/hazo_get_auth.server.js"
|
|
47
|
+
},
|
|
48
|
+
"./server": {
|
|
49
|
+
"types": "./dist/server/index.d.ts",
|
|
50
|
+
"import": "./dist/server/index.js"
|
|
35
51
|
}
|
|
36
52
|
},
|
|
37
53
|
"files": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// file_description: email verification layout specific configuration helpers
|
|
2
2
|
// section: imports
|
|
3
|
-
import type { LayoutFieldMap, LayoutFieldMapOverrides } from "
|
|
3
|
+
import type { LayoutFieldMap, LayoutFieldMapOverrides } from "../../shared/config/layout_customization";
|
|
4
4
|
import {
|
|
5
5
|
resolveButtonPalette,
|
|
6
6
|
resolveFieldDefinitions,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type ButtonPaletteOverrides,
|
|
10
10
|
type LayoutLabelDefaults,
|
|
11
11
|
type LayoutLabelOverrides,
|
|
12
|
-
} from "
|
|
12
|
+
} from "../../shared/config/layout_customization";
|
|
13
13
|
|
|
14
14
|
// section: field_identifiers
|
|
15
15
|
export const EMAIL_VERIFICATION_FIELD_IDS = {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { useRouter, useSearchParams } from "next/navigation";
|
|
5
5
|
import { toast } from "sonner";
|
|
6
|
-
import type { LayoutDataClient } from "
|
|
7
|
-
import { EMAIL_VERIFICATION_FIELD_IDS, type EmailVerificationFieldId } from "
|
|
8
|
-
import { validateEmail } from "
|
|
6
|
+
import type { LayoutDataClient } from "../../shared/data/layout_data_client";
|
|
7
|
+
import { EMAIL_VERIFICATION_FIELD_IDS, type EmailVerificationFieldId } from "../config/email_verification_field_config";
|
|
8
|
+
import { validateEmail } from "../../shared/utils/validation";
|
|
9
9
|
|
|
10
10
|
// section: types
|
|
11
11
|
export type EmailVerificationFormValues = Record<EmailVerificationFieldId, string>;
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
|
|
5
5
|
// section: imports
|
|
6
|
-
import { Input } from "
|
|
7
|
-
import { Button } from "
|
|
8
|
-
import { FormFieldWrapper } from "
|
|
9
|
-
import { FormHeader } from "
|
|
10
|
-
import { FormActionButtons } from "
|
|
11
|
-
import { TwoColumnAuthLayout } from "
|
|
6
|
+
import { Input } from "../../ui/input";
|
|
7
|
+
import { Button } from "../../ui/button";
|
|
8
|
+
import { FormFieldWrapper } from "../shared/components/form_field_wrapper";
|
|
9
|
+
import { FormHeader } from "../shared/components/form_header";
|
|
10
|
+
import { FormActionButtons } from "../shared/components/form_action_buttons";
|
|
11
|
+
import { TwoColumnAuthLayout } from "../shared/components/two_column_auth_layout";
|
|
12
12
|
import {
|
|
13
13
|
type ButtonPaletteOverrides,
|
|
14
14
|
type LayoutFieldMapOverrides,
|
|
15
15
|
type LayoutLabelOverrides,
|
|
16
|
-
} from "
|
|
16
|
+
} from "../shared/config/layout_customization";
|
|
17
17
|
import {
|
|
18
18
|
EMAIL_VERIFICATION_FIELD_IDS,
|
|
19
19
|
createEmailVerificationFieldDefinitions,
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
EMAIL_VERIFICATION_ERROR_LABEL_DEFAULTS,
|
|
24
24
|
type EmailVerificationSuccessLabels,
|
|
25
25
|
type EmailVerificationErrorLabels,
|
|
26
|
-
} from "
|
|
26
|
+
} from "./config/email_verification_field_config";
|
|
27
27
|
import {
|
|
28
28
|
use_email_verification,
|
|
29
29
|
type UseEmailVerificationResult,
|
|
30
|
-
} from "
|
|
31
|
-
import { type LayoutDataClient } from "
|
|
30
|
+
} from "./hooks/use_email_verification";
|
|
31
|
+
import { type LayoutDataClient } from "../shared/data/layout_data_client";
|
|
32
32
|
import { CheckCircle, XCircle, Loader2 } from "lucide-react";
|
|
33
|
-
import { AlreadyLoggedInGuard } from "
|
|
33
|
+
import { AlreadyLoggedInGuard } from "../shared/components/already_logged_in_guard";
|
|
34
34
|
|
|
35
35
|
// section: types
|
|
36
36
|
export type EmailVerificationLayoutProps<TClient = unknown> = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// file_description: forgot password layout specific configuration helpers
|
|
2
2
|
// section: imports
|
|
3
|
-
import type { LayoutFieldMap, LayoutFieldMapOverrides } from "
|
|
3
|
+
import type { LayoutFieldMap, LayoutFieldMapOverrides } from "../../shared/config/layout_customization";
|
|
4
4
|
import {
|
|
5
5
|
resolveButtonPalette,
|
|
6
6
|
resolveFieldDefinitions,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type ButtonPaletteOverrides,
|
|
10
10
|
type LayoutLabelDefaults,
|
|
11
11
|
type LayoutLabelOverrides,
|
|
12
|
-
} from "
|
|
12
|
+
} from "../../shared/config/layout_customization";
|
|
13
13
|
|
|
14
14
|
// section: field_identifiers
|
|
15
15
|
export const FORGOT_PASSWORD_FIELD_IDS = {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// section: imports
|
|
3
3
|
import { useCallback, useMemo, useState } from "react";
|
|
4
4
|
import { toast } from "sonner";
|
|
5
|
-
import type { LayoutDataClient } from "
|
|
6
|
-
import { FORGOT_PASSWORD_FIELD_IDS, type ForgotPasswordFieldId } from "
|
|
7
|
-
import { validateEmail } from "
|
|
5
|
+
import type { LayoutDataClient } from "../../shared/data/layout_data_client";
|
|
6
|
+
import { FORGOT_PASSWORD_FIELD_IDS, type ForgotPasswordFieldId } from "../config/forgot_password_field_config";
|
|
7
|
+
import { validateEmail } from "../../shared/utils/validation";
|
|
8
8
|
|
|
9
9
|
// section: types
|
|
10
10
|
export type ForgotPasswordFormValues = Record<ForgotPasswordFieldId, string>;
|
|
@@ -3,28 +3,28 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
|
|
5
5
|
// section: imports
|
|
6
|
-
import { Input } from "
|
|
7
|
-
import { FormFieldWrapper } from "
|
|
8
|
-
import { FormHeader } from "
|
|
9
|
-
import { FormActionButtons } from "
|
|
10
|
-
import { TwoColumnAuthLayout } from "
|
|
11
|
-
import { AlreadyLoggedInGuard } from "
|
|
6
|
+
import { Input } from "../../ui/input";
|
|
7
|
+
import { FormFieldWrapper } from "../shared/components/form_field_wrapper";
|
|
8
|
+
import { FormHeader } from "../shared/components/form_header";
|
|
9
|
+
import { FormActionButtons } from "../shared/components/form_action_buttons";
|
|
10
|
+
import { TwoColumnAuthLayout } from "../shared/components/two_column_auth_layout";
|
|
11
|
+
import { AlreadyLoggedInGuard } from "../shared/components/already_logged_in_guard";
|
|
12
12
|
import {
|
|
13
13
|
type ButtonPaletteOverrides,
|
|
14
14
|
type LayoutFieldMapOverrides,
|
|
15
15
|
type LayoutLabelOverrides,
|
|
16
|
-
} from "
|
|
16
|
+
} from "../shared/config/layout_customization";
|
|
17
17
|
import {
|
|
18
18
|
FORGOT_PASSWORD_FIELD_IDS,
|
|
19
19
|
createForgotPasswordFieldDefinitions,
|
|
20
20
|
resolveForgotPasswordButtonPalette,
|
|
21
21
|
resolveForgotPasswordLabels,
|
|
22
|
-
} from "
|
|
22
|
+
} from "./config/forgot_password_field_config";
|
|
23
23
|
import {
|
|
24
24
|
use_forgot_password_form,
|
|
25
25
|
type UseForgotPasswordFormResult,
|
|
26
|
-
} from "
|
|
27
|
-
import { type LayoutDataClient } from "
|
|
26
|
+
} from "./hooks/use_forgot_password_form";
|
|
27
|
+
import { type LayoutDataClient } from "../shared/data/layout_data_client";
|
|
28
28
|
|
|
29
29
|
// section: types
|
|
30
30
|
export type ForgotPasswordLayoutProps<TClient = unknown> = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// file_description: login layout specific configuration helpers
|
|
2
2
|
// section: imports
|
|
3
|
-
import type { LayoutFieldMap, LayoutFieldMapOverrides } from "
|
|
3
|
+
import type { LayoutFieldMap, LayoutFieldMapOverrides } from "../../shared/config/layout_customization";
|
|
4
4
|
import {
|
|
5
5
|
resolveButtonPalette,
|
|
6
6
|
resolveFieldDefinitions,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type ButtonPaletteOverrides,
|
|
10
10
|
type LayoutLabelDefaults,
|
|
11
11
|
type LayoutLabelOverrides,
|
|
12
|
-
} from "
|
|
12
|
+
} from "../../shared/config/layout_customization";
|
|
13
13
|
|
|
14
14
|
// section: field_identifiers
|
|
15
15
|
export const LOGIN_FIELD_IDS = {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// section: imports
|
|
3
3
|
import { useCallback, useMemo, useState, useEffect } from "react";
|
|
4
4
|
import { useRouter } from "next/navigation";
|
|
5
|
-
import type { LayoutDataClient } from "
|
|
6
|
-
import { LOGIN_FIELD_IDS, type LoginFieldId } from "
|
|
7
|
-
import { validateEmail } from "
|
|
8
|
-
import { get_client_ip } from "
|
|
9
|
-
import { trigger_auth_status_refresh } from "
|
|
5
|
+
import type { LayoutDataClient } from "../../shared/data/layout_data_client";
|
|
6
|
+
import { LOGIN_FIELD_IDS, type LoginFieldId } from "../config/login_field_config";
|
|
7
|
+
import { validateEmail } from "../../shared/utils/validation";
|
|
8
|
+
import { get_client_ip } from "../../shared/utils/ip_address";
|
|
9
|
+
import { trigger_auth_status_refresh } from "../../shared/hooks/use_auth_status";
|
|
10
10
|
|
|
11
11
|
// section: types
|
|
12
12
|
export type LoginFormValues = Record<LoginFieldId, string>;
|
|
@@ -4,30 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
// section: imports
|
|
6
6
|
import Link from "next/link";
|
|
7
|
-
import { Input } from "
|
|
8
|
-
import { PasswordField } from "
|
|
9
|
-
import { FormFieldWrapper } from "
|
|
10
|
-
import { FormHeader } from "
|
|
11
|
-
import { FormActionButtons } from "
|
|
12
|
-
import { TwoColumnAuthLayout } from "
|
|
7
|
+
import { Input } from "../../ui/input";
|
|
8
|
+
import { PasswordField } from "../shared/components/password_field";
|
|
9
|
+
import { FormFieldWrapper } from "../shared/components/form_field_wrapper";
|
|
10
|
+
import { FormHeader } from "../shared/components/form_header";
|
|
11
|
+
import { FormActionButtons } from "../shared/components/form_action_buttons";
|
|
12
|
+
import { TwoColumnAuthLayout } from "../shared/components/two_column_auth_layout";
|
|
13
13
|
import { CheckCircle } from "lucide-react";
|
|
14
|
-
import { AlreadyLoggedInGuard } from "
|
|
14
|
+
import { AlreadyLoggedInGuard } from "../shared/components/already_logged_in_guard";
|
|
15
15
|
import {
|
|
16
16
|
type ButtonPaletteOverrides,
|
|
17
17
|
type LayoutFieldMapOverrides,
|
|
18
18
|
type LayoutLabelOverrides,
|
|
19
|
-
} from "
|
|
19
|
+
} from "../shared/config/layout_customization";
|
|
20
20
|
import {
|
|
21
21
|
LOGIN_FIELD_IDS,
|
|
22
22
|
createLoginFieldDefinitions,
|
|
23
23
|
resolveLoginButtonPalette,
|
|
24
24
|
resolveLoginLabels,
|
|
25
|
-
} from "
|
|
25
|
+
} from "./config/login_field_config";
|
|
26
26
|
import {
|
|
27
27
|
use_login_form,
|
|
28
28
|
type UseLoginFormResult,
|
|
29
|
-
} from "
|
|
30
|
-
import { type LayoutDataClient } from "
|
|
29
|
+
} from "./hooks/use_login_form";
|
|
30
|
+
import { type LayoutDataClient } from "../shared/data/layout_data_client";
|
|
31
31
|
|
|
32
32
|
// section: types
|
|
33
33
|
export type LoginLayoutProps<TClient = unknown> = {
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
// section: imports
|
|
6
6
|
import { useState } from "react";
|
|
7
|
-
import { Input } from "
|
|
8
|
-
import { Label } from "
|
|
9
|
-
import { Button } from "
|
|
7
|
+
import { Input } from "../../../ui/input";
|
|
8
|
+
import { Label } from "../../../ui/label";
|
|
9
|
+
import { Button } from "../../../ui/button";
|
|
10
10
|
import { Pencil, CheckCircle2, XCircle } from "lucide-react";
|
|
11
11
|
|
|
12
12
|
// section: types
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
DialogHeader,
|
|
11
11
|
DialogTitle,
|
|
12
12
|
DialogDescription,
|
|
13
|
-
} from "
|
|
14
|
-
import { Button } from "
|
|
15
|
-
import { PasswordField } from "
|
|
16
|
-
import { FormFieldWrapper } from "
|
|
17
|
-
import type { PasswordRequirementOptions } from "
|
|
13
|
+
} from "../../../ui/dialog";
|
|
14
|
+
import { Button } from "../../../ui/button";
|
|
15
|
+
import { PasswordField } from "../../shared/components/password_field";
|
|
16
|
+
import { FormFieldWrapper } from "../../shared/components/form_field_wrapper";
|
|
17
|
+
import type { PasswordRequirementOptions } from "../../shared/config/layout_customization";
|
|
18
18
|
|
|
19
19
|
// section: types
|
|
20
20
|
export type ButtonPalette = {
|