hazo_auth 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +22 -1
  2. package/package.json +3 -3
  3. package/src/app/api/hazo_auth/auth/upload_profile_picture/route.ts +8 -8
  4. package/src/app/api/hazo_auth/change_password/route.ts +7 -7
  5. package/src/app/api/hazo_auth/forgot_password/route.ts +4 -4
  6. package/src/app/api/hazo_auth/get_auth/route.ts +4 -4
  7. package/src/app/api/hazo_auth/invalidate_cache/route.ts +5 -5
  8. package/src/app/api/hazo_auth/library_photos/route.ts +3 -3
  9. package/src/app/api/hazo_auth/login/route.ts +4 -4
  10. package/src/app/api/hazo_auth/logout/route.ts +4 -4
  11. package/src/app/api/hazo_auth/me/route.ts +1 -1
  12. package/src/app/api/hazo_auth/profile_picture/[filename]/route.ts +1 -1
  13. package/src/app/api/hazo_auth/register/route.ts +4 -4
  14. package/src/app/api/hazo_auth/remove_profile_picture/route.ts +5 -5
  15. package/src/app/api/hazo_auth/resend_verification/route.ts +4 -4
  16. package/src/app/api/hazo_auth/reset_password/route.ts +5 -5
  17. package/src/app/api/hazo_auth/update_user/route.ts +5 -5
  18. package/src/app/api/hazo_auth/upload_profile_picture/route.ts +8 -8
  19. package/src/app/api/hazo_auth/user_management/permissions/route.ts +4 -4
  20. package/src/app/api/hazo_auth/user_management/roles/route.ts +5 -5
  21. package/src/app/api/hazo_auth/user_management/users/roles/route.ts +5 -5
  22. package/src/app/api/hazo_auth/user_management/users/route.ts +6 -6
  23. package/src/app/api/hazo_auth/validate_reset_token/route.ts +4 -4
  24. package/src/app/api/hazo_auth/verify_email/route.ts +4 -4
  25. package/src/app/api/migrations/apply/route.ts +3 -3
  26. package/src/app/hazo_auth/forgot_password/forgot_password_page_client.tsx +4 -4
  27. package/src/app/hazo_auth/forgot_password/page.tsx +2 -2
  28. package/src/app/hazo_auth/login/login_page_client.tsx +5 -5
  29. package/src/app/hazo_auth/login/page.tsx +2 -2
  30. package/src/app/hazo_auth/my_settings/my_settings_page_client.tsx +3 -3
  31. package/src/app/hazo_auth/my_settings/page.tsx +2 -2
  32. package/src/app/hazo_auth/register/page.tsx +2 -2
  33. package/src/app/hazo_auth/register/register_page_client.tsx +4 -4
  34. package/src/app/hazo_auth/reset_password/page.tsx +2 -2
  35. package/src/app/hazo_auth/reset_password/reset_password_page_client.tsx +4 -4
  36. package/src/app/hazo_auth/user_management/page.tsx +1 -1
  37. package/src/app/hazo_auth/user_management/user_management_page_client.tsx +1 -1
  38. package/src/app/hazo_auth/verify_email/page.tsx +2 -2
  39. package/src/app/hazo_auth/verify_email/verify_email_page_client.tsx +4 -4
  40. package/src/app/hazo_connect/api/sqlite/data/route.ts +1 -1
  41. package/src/app/hazo_connect/api/sqlite/schema/route.ts +1 -1
  42. package/src/app/hazo_connect/api/sqlite/tables/route.ts +1 -1
  43. package/src/app/layout.tsx +1 -1
  44. package/src/app/page.tsx +1 -1
  45. package/src/components/layouts/email_verification/config/email_verification_field_config.ts +2 -2
  46. package/src/components/layouts/email_verification/hooks/use_email_verification.ts +3 -3
  47. package/src/components/layouts/email_verification/index.tsx +11 -11
  48. package/src/components/layouts/forgot_password/config/forgot_password_field_config.ts +2 -2
  49. package/src/components/layouts/forgot_password/hooks/use_forgot_password_form.ts +3 -3
  50. package/src/components/layouts/forgot_password/index.tsx +10 -10
  51. package/src/components/layouts/login/config/login_field_config.ts +2 -2
  52. package/src/components/layouts/login/hooks/use_login_form.ts +5 -5
  53. package/src/components/layouts/login/index.tsx +11 -11
  54. package/src/components/layouts/my_settings/components/editable_field.tsx +3 -3
  55. package/src/components/layouts/my_settings/components/password_change_dialog.tsx +5 -5
  56. package/src/components/layouts/my_settings/components/profile_picture_dialog.tsx +4 -4
  57. package/src/components/layouts/my_settings/components/profile_picture_display.tsx +2 -2
  58. package/src/components/layouts/my_settings/components/profile_picture_gravatar_tab.tsx +3 -3
  59. package/src/components/layouts/my_settings/components/profile_picture_library_tab.tsx +5 -5
  60. package/src/components/layouts/my_settings/components/profile_picture_upload_tab.tsx +4 -4
  61. package/src/components/layouts/my_settings/config/my_settings_field_config.ts +2 -2
  62. package/src/components/layouts/my_settings/hooks/use_my_settings.ts +2 -2
  63. package/src/components/layouts/my_settings/index.tsx +5 -5
  64. package/src/components/layouts/register/config/register_field_config.ts +2 -2
  65. package/src/components/layouts/register/hooks/use_register_form.ts +4 -4
  66. package/src/components/layouts/register/index.tsx +11 -11
  67. package/src/components/layouts/reset_password/config/reset_password_field_config.ts +2 -2
  68. package/src/components/layouts/reset_password/hooks/use_reset_password_form.ts +4 -4
  69. package/src/components/layouts/reset_password/index.tsx +10 -10
  70. package/src/components/layouts/shared/components/already_logged_in_guard.tsx +4 -4
  71. package/src/components/layouts/shared/components/form_action_buttons.tsx +2 -2
  72. package/src/components/layouts/shared/components/form_field_wrapper.tsx +2 -2
  73. package/src/components/layouts/shared/components/logout_button.tsx +2 -2
  74. package/src/components/layouts/shared/components/password_field.tsx +3 -3
  75. package/src/components/layouts/shared/components/profile_pic_menu.tsx +5 -5
  76. package/src/components/layouts/shared/components/profile_pic_menu_wrapper.tsx +1 -1
  77. package/src/components/layouts/shared/components/sidebar_layout_wrapper.tsx +3 -3
  78. package/src/components/layouts/shared/components/two_column_auth_layout.tsx +1 -1
  79. package/src/components/layouts/shared/components/unauthorized_guard.tsx +2 -2
  80. package/src/components/layouts/shared/hooks/use_hazo_auth.ts +1 -1
  81. package/src/components/layouts/shared/utils/validation.ts +1 -1
  82. package/src/components/layouts/user_management/components/roles_matrix.tsx +7 -7
  83. package/src/components/layouts/user_management/index.tsx +10 -10
  84. package/src/components/ui/alert-dialog.tsx +2 -2
  85. package/src/components/ui/avatar.tsx +1 -1
  86. package/src/components/ui/button.tsx +1 -1
  87. package/src/components/ui/checkbox.tsx +1 -1
  88. package/src/components/ui/dialog.tsx +1 -1
  89. package/src/components/ui/dropdown-menu.tsx +1 -1
  90. package/src/components/ui/hazo_ui_tooltip.tsx +1 -1
  91. package/src/components/ui/input.tsx +1 -1
  92. package/src/components/ui/label.tsx +1 -1
  93. package/src/components/ui/separator.tsx +1 -1
  94. package/src/components/ui/sheet.tsx +1 -1
  95. package/src/components/ui/sidebar.tsx +8 -8
  96. package/src/components/ui/skeleton.tsx +1 -1
  97. package/src/components/ui/switch.tsx +1 -1
  98. package/src/components/ui/table.tsx +1 -1
  99. package/src/components/ui/tabs.tsx +1 -1
  100. package/src/components/ui/tooltip.tsx +1 -1
  101. package/src/components/ui/vertical-tabs.tsx +1 -1
  102. package/src/lib/app_logger.ts +1 -1
  103. package/src/lib/hazo_connect_setup.server.ts +2 -2
  104. package/src/stories/email_verification_layout.stories.tsx +2 -2
  105. package/src/stories/forgot_password_layout.stories.tsx +2 -2
  106. package/src/stories/login_layout.stories.tsx +2 -2
  107. package/src/stories/register_layout.stories.tsx +2 -2
  108. package/tsconfig.json +1 -4
package/README.md CHANGED
@@ -27,7 +27,28 @@ After installing the package, you need to set up configuration files in your pro
27
27
  - Add `ZEPTOMAIL_API_KEY=your_api_key_here` (if using Zeptomail)
28
28
  - Add other sensitive configuration values as needed
29
29
 
30
- **Important:** The configuration files must be located in your project root directory (where `process.cwd()` points to), not inside `node_modules`. The package reads configuration from `process.cwd()` at runtime.
30
+ **Important:** The configuration files must be located in your project root directory (where `process.cwd()` points to), not inside `node_modules`. The package reads configuration from `process.cwd()` at runtime, so storing them elsewhere (including `node_modules/hazo_auth`) will break runtime access.
31
+
32
+ ### Expose hazo_auth Routes in the Consumer App
33
+
34
+ Because `src/app/hazo_auth` (pages) and `src/app/api/hazo_auth` (API routes) need to be part of the consuming Next.js app’s routing tree, make sure they exist in your project’s `src/app` directory. Two recommended approaches:
35
+
36
+ 1. **Create symlinks (preferred during development):**
37
+ ```bash
38
+ mkdir -p src/app/api src/app
39
+ ln -s ../../node_modules/hazo_auth/src/app/api/hazo_auth src/app/api/hazo_auth
40
+ ln -s ../../node_modules/hazo_auth/src/app/hazo_auth src/app/hazo_auth
41
+ ```
42
+ Adjust the relative paths if your project structure differs.
43
+
44
+ 2. **Copy the directories (useful for deployment or when symlinks cause issues):**
45
+ ```bash
46
+ cp -R node_modules/hazo_auth/src/app/api/hazo_auth src/app/api/hazo_auth
47
+ cp -R node_modules/hazo_auth/src/app/hazo_auth src/app/hazo_auth
48
+ ```
49
+ Add an npm script (e.g., `postinstall`) to automate copying after installations or updates.
50
+
51
+ > The package expects these routes to live at `src/app/api/hazo_auth` and `src/app/hazo_auth` inside the consumer project. Without copying or linking them, Next.js won’t mount the auth pages or APIs.
31
52
 
32
53
  ## Authentication Service
33
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_auth",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "files": [
5
5
  "src/**/*",
6
6
  "public/file.svg",
@@ -101,8 +101,8 @@
101
101
  "@types/react-dom": "^18",
102
102
  "better-sqlite3": "^12.4.1",
103
103
  "cross-env": "^10.1.0",
104
- "eslint": "^9.0.0",
105
- "eslint-config-next": "^16.0.3",
104
+ "eslint": "^8.57.0",
105
+ "eslint-config-next": "^14.2.7",
106
106
  "eslint-plugin-storybook": "^10.0.6",
107
107
  "jest": "^30.2.0",
108
108
  "jest-environment-jsdom": "^29.7.0",
@@ -1,14 +1,14 @@
1
1
  // file_description: API route for uploading profile pictures
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { get_profile_picture_config } from "@/lib/profile_picture_config.server";
7
- import { get_file_types_config } from "@/lib/file_types_config.server";
8
- import { update_user_profile_picture } from "@/lib/services/profile_picture_service";
4
+ import { get_hazo_connect_instance } from "../../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../../lib/app_logger";
6
+ import { get_profile_picture_config } from "../../../../../lib/profile_picture_config.server";
7
+ import { get_file_types_config } from "../../../../../lib/file_types_config.server";
8
+ import { update_user_profile_picture } from "../../../../../lib/services/profile_picture_service";
9
9
  import { createCrudService } from "hazo_connect/server";
10
- import { map_db_source_to_ui } from "@/lib/services/profile_picture_source_mapper";
11
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
10
+ import { map_db_source_to_ui } from "../../../../../lib/services/profile_picture_source_mapper";
11
+ import { get_filename, get_line_number } from "../../../../../lib/utils/api_route_helpers";
12
12
  import fs from "fs";
13
13
  import path from "path";
14
14
 
@@ -20,7 +20,7 @@ export async function POST(request: NextRequest) {
20
20
  // Use centralized auth check
21
21
  let user_id: string;
22
22
  try {
23
- const { require_auth } = await import("@/lib/auth/auth_utils.server");
23
+ const { require_auth } = await import("../../../../../lib/auth/auth_utils.server");
24
24
  const user = await require_auth(request);
25
25
  user_id = user.user_id;
26
26
  } catch (error) {
@@ -1,13 +1,13 @@
1
1
  // file_description: API route for changing user password
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { change_password } from "@/lib/services/password_change_service";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
- import { require_auth } from "@/lib/auth/auth_utils.server";
9
- import { get_auth_cache } from "@/lib/auth/auth_cache";
10
- import { get_auth_utility_config } from "@/lib/auth_utility_config.server";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { change_password } from "../../../../lib/services/password_change_service";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
+ import { require_auth } from "../../../../lib/auth/auth_utils.server";
9
+ import { get_auth_cache } from "../../../../lib/auth/auth_cache";
10
+ import { get_auth_utility_config } from "../../../../lib/auth_utility_config.server";
11
11
 
12
12
  // section: api_handler
13
13
  export async function POST(request: NextRequest) {
@@ -1,10 +1,10 @@
1
1
  // file_description: API route for password reset requests using hazo_connect
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { request_password_reset } from "@/lib/services/password_reset_service";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { request_password_reset } from "../../../../lib/services/password_reset_service";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
8
 
9
9
  // section: api_handler
10
10
  export async function POST(request: NextRequest) {
@@ -1,10 +1,10 @@
1
1
  // file_description: API route for hazo_get_auth utility (client-side calls)
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { hazo_get_auth } from "@/lib/auth/hazo_get_auth.server";
5
- import { PermissionError } from "@/lib/auth/auth_types";
6
- import { create_app_logger } from "@/lib/app_logger";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { hazo_get_auth } from "../../../../lib/auth/hazo_get_auth.server";
5
+ import { PermissionError } from "../../../../lib/auth/auth_types";
6
+ import { create_app_logger } from "../../../../lib/app_logger";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
8
 
9
9
  // section: route_config
10
10
  export const dynamic = "force-dynamic";
@@ -1,11 +1,11 @@
1
1
  // file_description: API route for manual cache invalidation (admin endpoint)
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_auth_cache } from "@/lib/auth/auth_cache";
5
- import { get_auth_utility_config } from "@/lib/auth_utility_config.server";
6
- import { create_app_logger } from "@/lib/app_logger";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
- import { hazo_get_auth } from "@/lib/auth/hazo_get_auth.server";
4
+ import { get_auth_cache } from "../../../../lib/auth/auth_cache";
5
+ import { get_auth_utility_config } from "../../../../lib/auth_utility_config.server";
6
+ import { create_app_logger } from "../../../../lib/app_logger";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
+ import { hazo_get_auth } from "../../../../lib/auth/hazo_get_auth.server";
9
9
 
10
10
  // section: route_config
11
11
  export const dynamic = "force-dynamic";
@@ -1,9 +1,9 @@
1
1
  // file_description: API route for listing library photo categories and photos in categories
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_library_categories, get_library_photos } from "@/lib/services/profile_picture_service";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { get_library_categories, get_library_photos } from "../../../../lib/services/profile_picture_service";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
7
7
 
8
8
  // section: route_config
9
9
  export const dynamic = 'force-dynamic';
@@ -1,11 +1,11 @@
1
1
  // file_description: API route for user login authentication using hazo_connect
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { authenticate_user } from "@/lib/services/login_service";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { authenticate_user } from "../../../../lib/services/login_service";
7
7
  import { createCrudService } from "hazo_connect/server";
8
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
9
9
 
10
10
  // section: api_handler
11
11
  export async function POST(request: NextRequest) {
@@ -1,10 +1,10 @@
1
1
  // file_description: API route for user logout
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { create_app_logger } from "@/lib/app_logger";
5
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
6
- import { get_auth_cache } from "@/lib/auth/auth_cache";
7
- import { get_auth_utility_config } from "@/lib/auth_utility_config.server";
4
+ import { create_app_logger } from "../../../../lib/app_logger";
5
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
6
+ import { get_auth_cache } from "../../../../lib/auth/auth_cache";
7
+ import { get_auth_utility_config } from "../../../../lib/auth_utility_config.server";
8
8
 
9
9
  // section: api_handler
10
10
  export async function POST(request: NextRequest) {
@@ -1,7 +1,7 @@
1
1
  // file_description: API route to get current authenticated user information
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_authenticated_user_with_response } from "@/lib/auth/auth_utils.server";
4
+ import { get_authenticated_user_with_response } from "../../../../lib/auth/auth_utils.server";
5
5
 
6
6
  // section: api_handler
7
7
  export async function GET(request: NextRequest) {
@@ -1,7 +1,7 @@
1
1
  // file_description: API route to serve uploaded profile pictures
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_profile_picture_config } from "@/lib/profile_picture_config.server";
4
+ import { get_profile_picture_config } from "../../../../../lib/profile_picture_config.server";
5
5
  import fs from "fs";
6
6
  import path from "path";
7
7
 
@@ -1,10 +1,10 @@
1
1
  // file_description: API route for user registration using hazo_connect to insert into hazo_users table
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { register_user } from "@/lib/services/registration_service";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { register_user } from "../../../../lib/services/registration_service";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
8
 
9
9
  // section: api_handler
10
10
  export async function POST(request: NextRequest) {
@@ -1,10 +1,10 @@
1
1
  // file_description: API route for removing profile pictures
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { remove_user_profile_picture } from "@/lib/services/profile_picture_remove_service";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { remove_user_profile_picture } from "../../../../lib/services/profile_picture_remove_service";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
8
 
9
9
  // section: api_handler
10
10
  export async function DELETE(request: NextRequest) {
@@ -14,7 +14,7 @@ export async function DELETE(request: NextRequest) {
14
14
  // Use centralized auth check
15
15
  let user_id: string;
16
16
  try {
17
- const { require_auth } = await import("@/lib/auth/auth_utils.server");
17
+ const { require_auth } = await import("../../../../lib/auth/auth_utils.server");
18
18
  const user = await require_auth(request);
19
19
  user_id = user.user_id;
20
20
  } catch (error) {
@@ -1,10 +1,10 @@
1
1
  // file_description: API route for resending email verification using hazo_connect
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { resend_verification_email } from "@/lib/services/email_verification_service";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { resend_verification_email } from "../../../../lib/services/email_verification_service";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
8
 
9
9
  // section: api_handler
10
10
  export async function POST(request: NextRequest) {
@@ -1,11 +1,11 @@
1
1
  // file_description: API route for resetting user password using a reset token
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { reset_password } from "@/lib/services/password_reset_service";
6
- import { create_app_logger } from "@/lib/app_logger";
7
- import { get_password_requirements_config } from "@/lib/password_requirements_config.server";
8
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { reset_password } from "../../../../lib/services/password_reset_service";
6
+ import { create_app_logger } from "../../../../lib/app_logger";
7
+ import { get_password_requirements_config } from "../../../../lib/password_requirements_config.server";
8
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
9
9
 
10
10
  // section: api_handler
11
11
  export async function POST(request: NextRequest) {
@@ -1,11 +1,11 @@
1
1
  // file_description: API route for updating user profile information
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { update_user_profile } from "@/lib/services/user_update_service";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
- import { require_auth } from "@/lib/auth/auth_utils.server";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { update_user_profile } from "../../../../lib/services/user_update_service";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
+ import { require_auth } from "../../../../lib/auth/auth_utils.server";
9
9
 
10
10
  // section: api_handler
11
11
  export async function PATCH(request: NextRequest) {
@@ -1,14 +1,14 @@
1
1
  // file_description: API route for uploading profile pictures
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { get_profile_picture_config } from "@/lib/profile_picture_config.server";
7
- import { get_file_types_config } from "@/lib/file_types_config.server";
8
- import { update_user_profile_picture } from "@/lib/services/profile_picture_service";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { get_profile_picture_config } from "../../../../lib/profile_picture_config.server";
7
+ import { get_file_types_config } from "../../../../lib/file_types_config.server";
8
+ import { update_user_profile_picture } from "../../../../lib/services/profile_picture_service";
9
9
  import { createCrudService } from "hazo_connect/server";
10
- import { map_db_source_to_ui } from "@/lib/services/profile_picture_source_mapper";
11
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
10
+ import { map_db_source_to_ui } from "../../../../lib/services/profile_picture_source_mapper";
11
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
12
12
  import fs from "fs";
13
13
  import path from "path";
14
14
 
@@ -20,7 +20,7 @@ export async function POST(request: NextRequest) {
20
20
  // Use centralized auth check
21
21
  let user_id: string;
22
22
  try {
23
- const { require_auth } = await import("@/lib/auth/auth_utils.server");
23
+ const { require_auth } = await import("../../../../lib/auth/auth_utils.server");
24
24
  const user = await require_auth(request);
25
25
  user_id = user.user_id;
26
26
  } catch (error) {
@@ -1,11 +1,11 @@
1
1
  // file_description: API route for permissions management operations (list, migrate from config, update, delete)
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
4
+ import { get_hazo_connect_instance } from "../../../../../lib/hazo_connect_instance.server";
5
5
  import { createCrudService } from "hazo_connect/server";
6
- import { create_app_logger } from "@/lib/app_logger";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
- import { get_user_management_config } from "@/lib/user_management_config.server";
6
+ import { create_app_logger } from "../../../../../lib/app_logger";
7
+ import { get_filename, get_line_number } from "../../../../../lib/utils/api_route_helpers";
8
+ import { get_user_management_config } from "../../../../../lib/user_management_config.server";
9
9
 
10
10
  // section: route_config
11
11
  export const dynamic = 'force-dynamic';
@@ -1,12 +1,12 @@
1
1
  // file_description: API route for roles management operations (list roles with permissions, create role, update role permissions)
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
4
+ import { get_hazo_connect_instance } from "../../../../../lib/hazo_connect_instance.server";
5
5
  import { createCrudService, getSqliteAdminService } from "hazo_connect/server";
6
- import { create_app_logger } from "@/lib/app_logger";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
- import { get_auth_cache } from "@/lib/auth/auth_cache";
9
- import { get_auth_utility_config } from "@/lib/auth_utility_config.server";
6
+ import { create_app_logger } from "../../../../../lib/app_logger";
7
+ import { get_filename, get_line_number } from "../../../../../lib/utils/api_route_helpers";
8
+ import { get_auth_cache } from "../../../../../lib/auth/auth_cache";
9
+ import { get_auth_utility_config } from "../../../../../lib/auth_utility_config.server";
10
10
 
11
11
  // section: route_config
12
12
  export const dynamic = 'force-dynamic';
@@ -1,12 +1,12 @@
1
1
  // file_description: API route for managing user roles (assigning roles to users)
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
4
+ import { get_hazo_connect_instance } from "../../../../../../lib/hazo_connect_instance.server";
5
5
  import { createCrudService, getSqliteAdminService } from "hazo_connect/server";
6
- import { create_app_logger } from "@/lib/app_logger";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
- import { get_auth_cache } from "@/lib/auth/auth_cache";
9
- import { get_auth_utility_config } from "@/lib/auth_utility_config.server";
6
+ import { create_app_logger } from "../../../../../../lib/app_logger";
7
+ import { get_filename, get_line_number } from "../../../../../../lib/utils/api_route_helpers";
8
+ import { get_auth_cache } from "../../../../../../lib/auth/auth_cache";
9
+ import { get_auth_utility_config } from "../../../../../../lib/auth_utility_config.server";
10
10
 
11
11
  // section: route_config
12
12
  export const dynamic = 'force-dynamic';
@@ -1,13 +1,13 @@
1
1
  // file_description: API route for user management operations (list users, deactivate, reset password)
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
4
+ import { get_hazo_connect_instance } from "../../../../../lib/hazo_connect_instance.server";
5
5
  import { createCrudService } from "hazo_connect/server";
6
- import { create_app_logger } from "@/lib/app_logger";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
- import { request_password_reset } from "@/lib/services/password_reset_service";
9
- import { get_auth_cache } from "@/lib/auth/auth_cache";
10
- import { get_auth_utility_config } from "@/lib/auth_utility_config.server";
6
+ import { create_app_logger } from "../../../../../lib/app_logger";
7
+ import { get_filename, get_line_number } from "../../../../../lib/utils/api_route_helpers";
8
+ import { request_password_reset } from "../../../../../lib/services/password_reset_service";
9
+ import { get_auth_cache } from "../../../../../lib/auth/auth_cache";
10
+ import { get_auth_utility_config } from "../../../../../lib/auth_utility_config.server";
11
11
 
12
12
  // section: route_config
13
13
  export const dynamic = 'force-dynamic';
@@ -1,10 +1,10 @@
1
1
  // file_description: API route for validating password reset token without resetting password
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { validate_password_reset_token } from "@/lib/services/password_reset_service";
6
- import { create_app_logger } from "@/lib/app_logger";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { validate_password_reset_token } from "../../../../lib/services/password_reset_service";
6
+ import { create_app_logger } from "../../../../lib/app_logger";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
8
 
9
9
  // section: route_config
10
10
  export const dynamic = 'force-dynamic';
@@ -1,10 +1,10 @@
1
1
  // file_description: API route for email verification using hazo_connect
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
6
- import { verify_email_token } from "@/lib/services/email_verification_service";
7
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
+ import { verify_email_token } from "../../../../lib/services/email_verification_service";
7
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
8
8
 
9
9
  // section: route_config
10
10
  export const dynamic = 'force-dynamic';
@@ -1,11 +1,11 @@
1
1
  // file_description: API route to manually apply database migrations
2
2
  // section: imports
3
3
  import { NextRequest, NextResponse } from "next/server";
4
- import { get_hazo_connect_instance } from "@/lib/hazo_connect_instance.server";
5
- import { create_app_logger } from "@/lib/app_logger";
4
+ import { get_hazo_connect_instance } from "../../../../lib/hazo_connect_instance.server";
5
+ import { create_app_logger } from "../../../../lib/app_logger";
6
6
  import fs from "fs";
7
7
  import path from "path";
8
- import { get_filename, get_line_number } from "@/lib/utils/api_route_helpers";
8
+ import { get_filename, get_line_number } from "../../../../lib/utils/api_route_helpers";
9
9
 
10
10
  // section: api_handler
11
11
  export async function POST(request: NextRequest) {
@@ -4,10 +4,10 @@
4
4
 
5
5
  // section: imports
6
6
  import { useEffect, useState } from "react";
7
- import forgot_password_layout from "@/components/layouts/forgot_password";
8
- import { createLayoutDataClient } from "@/components/layouts/shared/data/layout_data_client";
9
- import { create_sqlite_hazo_connect } from "@/lib/hazo_connect_setup";
10
- import type { LayoutDataClient } from "@/components/layouts/shared/data/layout_data_client";
7
+ import forgot_password_layout from "../../../components/layouts/forgot_password";
8
+ import { createLayoutDataClient } from "../../../components/layouts/shared/data/layout_data_client";
9
+ import { create_sqlite_hazo_connect } from "../../../lib/hazo_connect_setup";
10
+ import type { LayoutDataClient } from "../../../components/layouts/shared/data/layout_data_client";
11
11
 
12
12
  // section: types
13
13
  type ForgotPasswordPageClientProps = {
@@ -1,8 +1,8 @@
1
1
  // file_description: render the forgot password page shell and mount the forgot password layout component within sidebar
2
2
  // section: imports
3
- import { SidebarLayoutWrapper } from "@/components/layouts/shared/components/sidebar_layout_wrapper";
3
+ import { SidebarLayoutWrapper } from "../../../components/layouts/shared/components/sidebar_layout_wrapper";
4
4
  import { ForgotPasswordPageClient } from "./forgot_password_page_client";
5
- import { get_forgot_password_config } from "@/lib/forgot_password_config.server";
5
+ import { get_forgot_password_config } from "../../../lib/forgot_password_config.server";
6
6
 
7
7
  // section: component
8
8
  export default function forgot_password_page() {
@@ -4,11 +4,11 @@
4
4
 
5
5
  // section: imports
6
6
  import { useEffect, useState } from "react";
7
- import login_layout from "@/components/layouts/login";
8
- import { createLayoutDataClient } from "@/components/layouts/shared/data/layout_data_client";
9
- import { create_sqlite_hazo_connect } from "@/lib/hazo_connect_setup";
10
- import { create_app_logger } from "@/lib/app_logger";
11
- import type { LayoutDataClient } from "@/components/layouts/shared/data/layout_data_client";
7
+ import login_layout from "../../../components/layouts/login";
8
+ import { createLayoutDataClient } from "../../../components/layouts/shared/data/layout_data_client";
9
+ import { create_sqlite_hazo_connect } from "../../../lib/hazo_connect_setup";
10
+ import { create_app_logger } from "../../../lib/app_logger";
11
+ import type { LayoutDataClient } from "../../../components/layouts/shared/data/layout_data_client";
12
12
 
13
13
  // section: types
14
14
  type LoginPageClientProps = {
@@ -1,8 +1,8 @@
1
1
  // file_description: render the login page shell and mount the login layout component within sidebar
2
2
  // section: imports
3
- import { SidebarLayoutWrapper } from "@/components/layouts/shared/components/sidebar_layout_wrapper";
3
+ import { SidebarLayoutWrapper } from "../../../components/layouts/shared/components/sidebar_layout_wrapper";
4
4
  import { LoginPageClient } from "./login_page_client";
5
- import { get_login_config } from "@/lib/login_config.server";
5
+ import { get_login_config } from "../../../lib/login_config.server";
6
6
 
7
7
  // section: component
8
8
  export default function login_page() {
@@ -4,9 +4,9 @@
4
4
 
5
5
  // section: imports
6
6
  import { useEffect, useState } from "react";
7
- import my_settings_layout from "@/components/layouts/my_settings";
8
- import type { LayoutDataClient } from "@/components/layouts/shared/data/layout_data_client";
9
- import type { PasswordRequirementOptions } from "@/components/layouts/shared/config/layout_customization";
7
+ import my_settings_layout from "../../../components/layouts/my_settings";
8
+ import type { LayoutDataClient } from "../../../components/layouts/shared/data/layout_data_client";
9
+ import type { PasswordRequirementOptions } from "../../../components/layouts/shared/config/layout_customization";
10
10
 
11
11
  // section: types
12
12
  type MySettingsPageClientProps = {
@@ -1,8 +1,8 @@
1
1
  // file_description: render the my settings page shell and mount the my settings layout component within sidebar
2
2
  // section: imports
3
- import { SidebarLayoutWrapper } from "@/components/layouts/shared/components/sidebar_layout_wrapper";
3
+ import { SidebarLayoutWrapper } from "../../../components/layouts/shared/components/sidebar_layout_wrapper";
4
4
  import { MySettingsPageClient } from "./my_settings_page_client";
5
- import { get_my_settings_config } from "@/lib/my_settings_config.server";
5
+ import { get_my_settings_config } from "../../../lib/my_settings_config.server";
6
6
 
7
7
  // section: component
8
8
  export default function my_settings_page() {
@@ -1,8 +1,8 @@
1
1
  // file_description: render the register page shell and mount the register layout component within sidebar
2
2
  // section: imports
3
- import { SidebarLayoutWrapper } from "@/components/layouts/shared/components/sidebar_layout_wrapper";
3
+ import { SidebarLayoutWrapper } from "../../../components/layouts/shared/components/sidebar_layout_wrapper";
4
4
  import { RegisterPageClient } from "./register_page_client";
5
- import { get_register_config } from "@/lib/register_config.server";
5
+ import { get_register_config } from "../../../lib/register_config.server";
6
6
 
7
7
  // section: component
8
8
  export default function register_page() {
@@ -4,10 +4,10 @@
4
4
 
5
5
  // section: imports
6
6
  import { useEffect, useState } from "react";
7
- import register_layout from "@/components/layouts/register";
8
- import { createLayoutDataClient } from "@/components/layouts/shared/data/layout_data_client";
9
- import { create_sqlite_hazo_connect } from "@/lib/hazo_connect_setup";
10
- import type { LayoutDataClient } from "@/components/layouts/shared/data/layout_data_client";
7
+ import register_layout from "../../../components/layouts/register";
8
+ import { createLayoutDataClient } from "../../../components/layouts/shared/data/layout_data_client";
9
+ import { create_sqlite_hazo_connect } from "../../../lib/hazo_connect_setup";
10
+ import type { LayoutDataClient } from "../../../components/layouts/shared/data/layout_data_client";
11
11
 
12
12
  // section: types
13
13
  type RegisterPageClientProps = {