hazo_auth 5.1.22 → 5.1.24
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 +63 -8
- package/SETUP_CHECKLIST.md +9 -7
- package/cli-src/lib/already_logged_in_config.server.ts +3 -0
- package/cli-src/lib/app_logger.ts +4 -1
- package/cli-src/lib/app_permissions_config.server.ts +3 -0
- package/cli-src/lib/app_user_data_config.server.ts +3 -0
- package/cli-src/lib/auth/auth_utils.server.ts +3 -0
- package/cli-src/lib/auth/hazo_get_auth.server.ts +3 -0
- package/cli-src/lib/auth/hazo_get_tenant_auth.server.ts +3 -0
- package/cli-src/lib/auth_utility_config.server.ts +3 -0
- package/cli-src/lib/branding_config.server.ts +3 -0
- package/cli-src/lib/config/config_loader.server.ts +4 -1
- package/cli-src/lib/cookies_config.server.ts +3 -0
- package/cli-src/lib/dev_lock_config.server.ts +3 -0
- package/cli-src/lib/email_verification_config.server.ts +3 -0
- package/cli-src/lib/file_types_config.server.ts +3 -0
- package/cli-src/lib/forgot_password_config.server.ts +3 -0
- package/cli-src/lib/hazo_connect_instance.server.ts +3 -0
- package/cli-src/lib/hazo_connect_setup.server.ts +4 -1
- package/cli-src/lib/login_config.server.ts +3 -0
- package/cli-src/lib/messages_config.server.ts +3 -0
- package/cli-src/lib/my_settings_config.server.ts +3 -0
- package/cli-src/lib/navbar_config.server.ts +3 -0
- package/cli-src/lib/oauth_config.server.ts +3 -0
- package/cli-src/lib/password_requirements_config.server.ts +3 -0
- package/cli-src/lib/profile_pic_menu_config.server.ts +3 -0
- package/cli-src/lib/profile_picture_config.server.ts +3 -0
- package/cli-src/lib/register_config.server.ts +3 -0
- package/cli-src/lib/reset_password_config.server.ts +3 -0
- package/cli-src/lib/scope_hierarchy_config.server.ts +3 -0
- package/cli-src/lib/ui_shell_config.server.ts +3 -0
- package/cli-src/lib/ui_sizes_config.server.ts +3 -0
- package/cli-src/lib/user_fields_config.server.ts +3 -0
- package/cli-src/lib/user_management_config.server.ts +3 -0
- package/cli-src/lib/user_profiles_config.server.ts +3 -0
- package/cli-src/lib/user_types_config.server.ts +3 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/dist/lib/already_logged_in_config.server.d.ts +1 -0
- package/dist/lib/already_logged_in_config.server.d.ts.map +1 -1
- package/dist/lib/already_logged_in_config.server.js +2 -0
- package/dist/lib/app_logger.d.ts +1 -0
- package/dist/lib/app_logger.d.ts.map +1 -1
- package/dist/lib/app_logger.js +3 -1
- package/dist/lib/app_permissions_config.server.d.ts +1 -0
- package/dist/lib/app_permissions_config.server.d.ts.map +1 -1
- package/dist/lib/app_permissions_config.server.js +2 -0
- package/dist/lib/app_user_data_config.server.d.ts +1 -0
- package/dist/lib/app_user_data_config.server.d.ts.map +1 -1
- package/dist/lib/app_user_data_config.server.js +2 -0
- package/dist/lib/auth/auth_utils.server.d.ts +1 -0
- package/dist/lib/auth/auth_utils.server.d.ts.map +1 -1
- package/dist/lib/auth/auth_utils.server.js +2 -0
- package/dist/lib/auth/hazo_get_auth.server.d.ts +1 -0
- package/dist/lib/auth/hazo_get_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.js +3 -0
- package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts +1 -0
- package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_tenant_auth.server.js +3 -0
- package/dist/lib/auth_utility_config.server.d.ts +1 -0
- package/dist/lib/auth_utility_config.server.d.ts.map +1 -1
- package/dist/lib/auth_utility_config.server.js +2 -0
- package/dist/lib/branding_config.server.d.ts +1 -0
- package/dist/lib/branding_config.server.d.ts.map +1 -1
- package/dist/lib/branding_config.server.js +2 -0
- package/dist/lib/config/config_loader.server.d.ts +1 -0
- package/dist/lib/config/config_loader.server.d.ts.map +1 -1
- package/dist/lib/config/config_loader.server.js +3 -1
- package/dist/lib/cookies_config.server.d.ts +1 -0
- package/dist/lib/cookies_config.server.d.ts.map +1 -1
- package/dist/lib/cookies_config.server.js +2 -0
- package/dist/lib/dev_lock_config.server.d.ts +1 -0
- package/dist/lib/dev_lock_config.server.d.ts.map +1 -1
- package/dist/lib/dev_lock_config.server.js +2 -0
- package/dist/lib/email_verification_config.server.d.ts +1 -0
- package/dist/lib/email_verification_config.server.d.ts.map +1 -1
- package/dist/lib/email_verification_config.server.js +2 -0
- package/dist/lib/file_types_config.server.d.ts +1 -0
- package/dist/lib/file_types_config.server.d.ts.map +1 -1
- package/dist/lib/file_types_config.server.js +2 -0
- package/dist/lib/forgot_password_config.server.d.ts +1 -0
- package/dist/lib/forgot_password_config.server.d.ts.map +1 -1
- package/dist/lib/forgot_password_config.server.js +2 -0
- package/dist/lib/hazo_connect_instance.server.d.ts +1 -0
- package/dist/lib/hazo_connect_instance.server.d.ts.map +1 -1
- package/dist/lib/hazo_connect_instance.server.js +3 -0
- package/dist/lib/hazo_connect_setup.server.d.ts +1 -0
- package/dist/lib/hazo_connect_setup.server.d.ts.map +1 -1
- package/dist/lib/hazo_connect_setup.server.js +2 -0
- package/dist/lib/login_config.server.d.ts +1 -0
- package/dist/lib/login_config.server.d.ts.map +1 -1
- package/dist/lib/login_config.server.js +2 -0
- package/dist/lib/messages_config.server.d.ts +1 -0
- package/dist/lib/messages_config.server.d.ts.map +1 -1
- package/dist/lib/messages_config.server.js +2 -0
- package/dist/lib/my_settings_config.server.d.ts +1 -0
- package/dist/lib/my_settings_config.server.d.ts.map +1 -1
- package/dist/lib/my_settings_config.server.js +2 -0
- package/dist/lib/navbar_config.server.d.ts +1 -0
- package/dist/lib/navbar_config.server.d.ts.map +1 -1
- package/dist/lib/navbar_config.server.js +2 -0
- package/dist/lib/oauth_config.server.d.ts +1 -0
- package/dist/lib/oauth_config.server.d.ts.map +1 -1
- package/dist/lib/oauth_config.server.js +2 -0
- package/dist/lib/password_requirements_config.server.d.ts +1 -0
- package/dist/lib/password_requirements_config.server.d.ts.map +1 -1
- package/dist/lib/password_requirements_config.server.js +2 -0
- package/dist/lib/profile_pic_menu_config.server.d.ts +1 -0
- package/dist/lib/profile_pic_menu_config.server.d.ts.map +1 -1
- package/dist/lib/profile_pic_menu_config.server.js +2 -0
- package/dist/lib/profile_picture_config.server.d.ts +1 -0
- package/dist/lib/profile_picture_config.server.d.ts.map +1 -1
- package/dist/lib/profile_picture_config.server.js +2 -0
- package/dist/lib/register_config.server.d.ts +1 -0
- package/dist/lib/register_config.server.d.ts.map +1 -1
- package/dist/lib/register_config.server.js +2 -0
- package/dist/lib/reset_password_config.server.d.ts +1 -0
- package/dist/lib/reset_password_config.server.d.ts.map +1 -1
- package/dist/lib/reset_password_config.server.js +2 -0
- package/dist/lib/scope_hierarchy_config.server.d.ts +1 -0
- package/dist/lib/scope_hierarchy_config.server.d.ts.map +1 -1
- package/dist/lib/scope_hierarchy_config.server.js +2 -0
- package/dist/lib/ui_shell_config.server.d.ts +1 -0
- package/dist/lib/ui_shell_config.server.d.ts.map +1 -1
- package/dist/lib/ui_shell_config.server.js +2 -0
- package/dist/lib/ui_sizes_config.server.d.ts +1 -0
- package/dist/lib/ui_sizes_config.server.d.ts.map +1 -1
- package/dist/lib/ui_sizes_config.server.js +2 -0
- package/dist/lib/user_fields_config.server.d.ts +1 -0
- package/dist/lib/user_fields_config.server.d.ts.map +1 -1
- package/dist/lib/user_fields_config.server.js +2 -0
- package/dist/lib/user_management_config.server.d.ts +1 -0
- package/dist/lib/user_management_config.server.d.ts.map +1 -1
- package/dist/lib/user_management_config.server.js +2 -0
- package/dist/lib/user_profiles_config.server.d.ts +1 -0
- package/dist/lib/user_profiles_config.server.d.ts.map +1 -1
- package/dist/lib/user_profiles_config.server.js +2 -0
- package/dist/lib/user_types_config.server.d.ts +1 -0
- package/dist/lib/user_types_config.server.d.ts.map +1 -1
- package/dist/lib/user_types_config.server.js +2 -0
- package/dist/page_components/create_firm.d.ts +1 -0
- package/dist/page_components/create_firm.d.ts.map +1 -1
- package/dist/page_components/create_firm.js +2 -0
- package/dist/server/config/config_loader.js +1 -1
- package/dist/server/routes/create_firm.d.ts +2 -2
- package/dist/server/routes/invitations.d.ts +2 -2
- package/dist/server/routes/verify_email.d.ts +1 -1
- package/dist/server-lib.d.ts +32 -0
- package/dist/server-lib.d.ts.map +1 -0
- package/dist/server-lib.js +46 -0
- package/dist/server_pages/forgot_password.d.ts +1 -0
- package/dist/server_pages/forgot_password.d.ts.map +1 -1
- package/dist/server_pages/forgot_password.js +2 -0
- package/dist/server_pages/login.d.ts +1 -0
- package/dist/server_pages/login.d.ts.map +1 -1
- package/dist/server_pages/login.js +2 -0
- package/dist/server_pages/my_settings.d.ts +1 -0
- package/dist/server_pages/my_settings.d.ts.map +1 -1
- package/dist/server_pages/my_settings.js +2 -0
- package/dist/server_pages/register.d.ts +1 -0
- package/dist/server_pages/register.d.ts.map +1 -1
- package/dist/server_pages/register.js +2 -0
- package/dist/server_pages/reset_password.d.ts +1 -0
- package/dist/server_pages/reset_password.d.ts.map +1 -1
- package/dist/server_pages/reset_password.js +2 -0
- package/dist/server_pages/verify_email.d.ts +1 -0
- package/dist/server_pages/verify_email.d.ts.map +1 -1
- package/dist/server_pages/verify_email.js +2 -0
- package/package.json +24 -6
- package/config/hazo_auth_config.ini +0 -782
- package/config/hazo_logs_config.ini +0 -32
- package/config/hazo_notify_config.ini +0 -158
package/README.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
A reusable authentication UI component package powered by Next.js, TailwindCSS, and shadcn. It integrates `hazo_config` for configuration management and `hazo_connect` for data access, enabling future components to stay aligned with platform conventions.
|
|
4
4
|
|
|
5
|
+
### What's New in v5.2.0 ⚠️ BREAKING CHANGE
|
|
6
|
+
|
|
7
|
+
**Server/Client Module Separation** - Complete fix for "Module not found: Can't resolve 'fs'" errors.
|
|
8
|
+
|
|
9
|
+
**Breaking Change - New Import Path:**
|
|
10
|
+
```typescript
|
|
11
|
+
// BEFORE (v5.1.x) - Server imports from main entry
|
|
12
|
+
import { hazo_get_auth, get_login_config } from "hazo_auth";
|
|
13
|
+
|
|
14
|
+
// AFTER (v5.2.0) - Server imports from dedicated entry point
|
|
15
|
+
import { hazo_get_auth, get_login_config } from "hazo_auth/server-lib";
|
|
16
|
+
|
|
17
|
+
// Client imports unchanged
|
|
18
|
+
import { ProfilePicMenu, use_auth_status } from "hazo_auth/client";
|
|
19
|
+
import { cn } from "hazo_auth"; // Still works
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Key Changes:**
|
|
23
|
+
- ✅ **New `hazo_auth/server-lib` entry point** - All server-only exports (auth functions, services, config loaders) now here
|
|
24
|
+
- ✅ **Clean main entry** - `hazo_auth` is now client-safe (components, types, utilities only)
|
|
25
|
+
- ✅ **Peer dependencies** - `hazo_config` and `hazo_connect` are now peer dependencies (install in your app)
|
|
26
|
+
- ✅ **Fixed import path** - Uses `hazo_config/server` (not deprecated `hazo_config/dist/lib`)
|
|
27
|
+
|
|
28
|
+
**Required Migration:**
|
|
29
|
+
```bash
|
|
30
|
+
# 1. Install peer dependencies
|
|
31
|
+
npm install hazo_config hazo_connect hazo_logs
|
|
32
|
+
|
|
33
|
+
# 2. Update imports in your server-side code
|
|
34
|
+
# Change: import { hazo_get_auth } from "hazo_auth"
|
|
35
|
+
# To: import { hazo_get_auth } from "hazo_auth/server-lib"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### What's New in v5.1.23 🔧
|
|
39
|
+
|
|
40
|
+
**FIX: Server/Client Bundling Issue** - Added `import "server-only"` guards to prevent accidental client bundling.
|
|
41
|
+
|
|
42
|
+
**Key Changes:**
|
|
43
|
+
- ✅ **Server-Only Guards** - Added `import "server-only"` to all server files preventing accidental client bundling
|
|
44
|
+
- ✅ **hazo_logs v1.0.10** - Upgraded with conditional exports for browser/node environments
|
|
45
|
+
- ✅ **Client Logging Support** - Logs API route now exports POST for client-side log ingestion
|
|
46
|
+
|
|
5
47
|
### What's New in v5.1.5 🐛
|
|
6
48
|
|
|
7
49
|
**CRITICAL BUGFIX**: Fixed incomplete migration from v4.x to v5.x - several files were still referencing the deprecated `hazo_user_roles` table instead of `hazo_user_scopes`. This release completes the scope-based role assignment architecture introduced in v5.0.
|
|
@@ -104,6 +146,19 @@ npm run dev
|
|
|
104
146
|
|
|
105
147
|
That's it! Visit `http://localhost:3000/hazo_auth/login` to see the login page.
|
|
106
148
|
|
|
149
|
+
### Tailwind v4 Setup (Required for Tailwind v4 Users)
|
|
150
|
+
|
|
151
|
+
If you're using Tailwind v4, add this to your `globals.css` AFTER the tailwindcss import:
|
|
152
|
+
|
|
153
|
+
```css
|
|
154
|
+
@import "tailwindcss";
|
|
155
|
+
|
|
156
|
+
/* Required: Enable Tailwind to scan hazo_auth package classes */
|
|
157
|
+
@source "../node_modules/hazo_auth/dist";
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Important:** Without this directive, Tailwind classes in hazo_auth components (hover states, colors, spacing) will not be compiled, resulting in broken styling.
|
|
161
|
+
|
|
107
162
|
### CLI Commands
|
|
108
163
|
|
|
109
164
|
```bash
|
|
@@ -313,19 +368,19 @@ import {
|
|
|
313
368
|
For server-side code (API routes, Server Components):
|
|
314
369
|
|
|
315
370
|
```typescript
|
|
316
|
-
// Use
|
|
317
|
-
import { hazo_get_auth, get_config_value } from "hazo_auth";
|
|
318
|
-
import { hazo_get_user_profiles } from "hazo_auth";
|
|
371
|
+
// Use hazo_auth/server-lib for server-side code
|
|
372
|
+
import { hazo_get_auth, get_config_value } from "hazo_auth/server-lib";
|
|
373
|
+
import { hazo_get_user_profiles } from "hazo_auth/server-lib";
|
|
319
374
|
```
|
|
320
375
|
|
|
321
376
|
### Why This Matters
|
|
322
377
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
378
|
+
Server-only code (Node.js APIs like `fs`, `path`, database access) must be kept separate from client bundles. The `hazo_auth/server-lib` entry point:
|
|
379
|
+
- Contains all server-only exports (auth functions, services, config loaders)
|
|
380
|
+
- Includes `import "server-only"` guard that throws build errors if imported in client code
|
|
381
|
+
- Uses peer dependencies (`hazo_config`, `hazo_connect`, `hazo_logs`) from your app
|
|
327
382
|
|
|
328
|
-
|
|
383
|
+
If you accidentally import from `hazo_auth/server-lib` in a client component, you'll get a helpful build error instead of a cryptic "Can't resolve 'fs'" message.
|
|
329
384
|
|
|
330
385
|
---
|
|
331
386
|
|
package/SETUP_CHECKLIST.md
CHANGED
|
@@ -7,8 +7,8 @@ This checklist provides step-by-step instructions for setting up the `hazo_auth`
|
|
|
7
7
|
The fastest way to set up hazo_auth:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
# 1. Install the package
|
|
11
|
-
npm install hazo_auth
|
|
10
|
+
# 1. Install the package and peer dependencies
|
|
11
|
+
npm install hazo_auth hazo_config hazo_connect hazo_logs
|
|
12
12
|
|
|
13
13
|
# 2. Initialize project (creates directories, copies config files)
|
|
14
14
|
npx hazo_auth init
|
|
@@ -55,12 +55,14 @@ node --version
|
|
|
55
55
|
|
|
56
56
|
## Phase 1: Installation & Config Files
|
|
57
57
|
|
|
58
|
-
### Step 1.1: Install the package
|
|
58
|
+
### Step 1.1: Install the package and peer dependencies
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
npm install hazo_auth
|
|
61
|
+
npm install hazo_auth hazo_config hazo_connect hazo_logs
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
**Note (v5.2.0+):** `hazo_config`, `hazo_connect`, and `hazo_logs` are now peer dependencies. You must install them in your project.
|
|
65
|
+
|
|
64
66
|
**Verify installation:**
|
|
65
67
|
```bash
|
|
66
68
|
ls node_modules/hazo_auth/package.json
|
|
@@ -1602,7 +1604,7 @@ Replace `hazo_get_auth` with `hazo_get_tenant_auth` in your API routes:
|
|
|
1602
1604
|
|
|
1603
1605
|
**Before (standard auth):**
|
|
1604
1606
|
```typescript
|
|
1605
|
-
import { hazo_get_auth } from "hazo_auth";
|
|
1607
|
+
import { hazo_get_auth } from "hazo_auth/server-lib";
|
|
1606
1608
|
|
|
1607
1609
|
export async function GET(request: NextRequest) {
|
|
1608
1610
|
const auth = await hazo_get_auth(request);
|
|
@@ -1612,7 +1614,7 @@ export async function GET(request: NextRequest) {
|
|
|
1612
1614
|
|
|
1613
1615
|
**After (tenant auth):**
|
|
1614
1616
|
```typescript
|
|
1615
|
-
import { hazo_get_tenant_auth } from "hazo_auth";
|
|
1617
|
+
import { hazo_get_tenant_auth } from "hazo_auth/server-lib";
|
|
1616
1618
|
|
|
1617
1619
|
export async function GET(request: NextRequest) {
|
|
1618
1620
|
const auth = await hazo_get_tenant_auth(request);
|
|
@@ -1627,7 +1629,7 @@ export async function GET(request: NextRequest) {
|
|
|
1627
1629
|
|
|
1628
1630
|
**Or use strict mode with error handling:**
|
|
1629
1631
|
```typescript
|
|
1630
|
-
import { require_tenant_auth, HazoAuthError } from "hazo_auth";
|
|
1632
|
+
import { require_tenant_auth, HazoAuthError } from "hazo_auth/server-lib";
|
|
1631
1633
|
|
|
1632
1634
|
export async function GET(request: NextRequest) {
|
|
1633
1635
|
try {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read already logged in configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value, get_config_boolean } from "./config/config_loader.server.js";
|
|
4
7
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
// file_description:
|
|
1
|
+
// file_description: server-only wrapper for the main app logging service using hazo_logs
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { createLogger } from "hazo_logs";
|
|
4
7
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read app permissions configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// This allows consuming apps to declare their required permissions with descriptions for debugging
|
|
3
6
|
// section: imports
|
|
4
7
|
import { read_config_section } from "./config/config_loader.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read app_user_data schema configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// Enables schema-based editing of app_user_data in User Management
|
|
3
6
|
// section: imports
|
|
4
7
|
import {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-side authentication utilities for checking login status in API routes
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { NextRequest, NextResponse } from "next/server";
|
|
4
7
|
import { get_hazo_connect_instance } from "../hazo_connect_instance.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-side implementation of hazo_get_auth utility for API routes
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { NextRequest } from "next/server";
|
|
4
7
|
import { get_hazo_connect_instance } from "../hazo_connect_instance.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: tenant-aware authentication function that extracts scope from request headers/cookies
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { NextRequest } from "next/server";
|
|
4
7
|
import { hazo_get_auth } from "./hazo_get_auth.server.js";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// file_description: shared utility for reading configuration from hazo_auth_config.ini using hazo_config
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
|
-
import { HazoConfig } from "hazo_config/
|
|
6
|
+
import { HazoConfig } from "hazo_config/server";
|
|
4
7
|
import path from "path";
|
|
5
8
|
import fs from "fs";
|
|
6
9
|
import { create_app_logger } from "../app_logger.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read dev lock configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value, get_config_boolean, get_config_number } from "./config/config_loader.server.js";
|
|
4
7
|
import { DEFAULT_DEV_LOCK } from "./config/default_config.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read email verification layout configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_already_logged_in_config } from "./already_logged_in_config.server.js";
|
|
4
7
|
import { get_config_value } from "./config/config_loader.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read forgot password layout configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_already_logged_in_config } from "./already_logged_in_config.server.js";
|
|
4
7
|
import { get_config_value } from "./config/config_loader.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: singleton instance of hazo_connect adapter - initialized once and reused across all routes
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// This ensures all routes/components use the same database connection
|
|
3
6
|
// Uses the new hazo_connect singleton API from hazo_connect/nextjs/setup
|
|
4
7
|
// Reads configuration from hazo_auth_config.ini using hazo_config
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// file_description: server-only helper to create hazo_connect instance (imports server-side code)
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// This file should only be imported in server contexts (API routes, server components)
|
|
3
6
|
// Reads configuration from hazo_auth_config.ini using hazo_config
|
|
4
7
|
// section: imports
|
|
5
8
|
import { createHazoConnect } from "hazo_connect/server";
|
|
6
|
-
import { HazoConfig } from "hazo_config/
|
|
9
|
+
import { HazoConfig } from "hazo_config/server";
|
|
7
10
|
import path from "path";
|
|
8
11
|
import fs from "fs";
|
|
9
12
|
import { create_app_logger } from "./app_logger.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read login layout configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value } from "./config/config_loader.server.js";
|
|
4
7
|
import { get_already_logged_in_config } from "./already_logged_in_config.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read my settings layout configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value } from "./config/config_loader.server.js";
|
|
4
7
|
import { get_user_fields_config } from "./user_fields_config.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read navbar configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value, get_config_boolean, get_config_number } from "./config/config_loader.server.js";
|
|
4
7
|
import { DEFAULT_NAVBAR } from "./config/default_config.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read OAuth configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value, get_config_boolean } from "./config/config_loader.server.js";
|
|
4
7
|
import { DEFAULT_OAUTH } from "./config/default_config.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read shared password requirements configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_number, get_config_boolean } from "./config/config_loader.server.js";
|
|
4
7
|
import { DEFAULT_PASSWORD_REQUIREMENTS } from "./config/default_config.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read profile picture menu configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value, get_config_boolean, get_config_array } from "./config/config_loader.server.js";
|
|
4
7
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read profile picture configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_boolean, get_config_value, get_config_number, read_config_section } from "./config/config_loader.server.js";
|
|
4
7
|
import { create_app_logger } from "./app_logger.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read register layout configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_boolean, get_config_value, read_config_section } from "./config/config_loader.server.js";
|
|
4
7
|
import { get_password_requirements_config } from "./password_requirements_config.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read reset password layout configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value } from "./config/config_loader.server.js";
|
|
4
7
|
import { get_already_logged_in_config } from "./already_logged_in_config.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: load ui shell layout settings from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value } from "./config/config_loader.server.js";
|
|
4
7
|
import { get_navbar_config, type NavbarConfig } from "./navbar_config.server.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// file_description: server-only helper to read user management configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
|
|
2
5
|
// section: imports
|
|
3
6
|
import { get_config_value, get_config_array, read_config_section } from "./config/config_loader.server.js";
|
|
4
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./contexts/hazo_auth_provider.js";
|
|
2
2
|
export * from "./contexts/hazo_auth_config.js";
|
|
3
3
|
export * from "./components/index.js";
|
|
4
|
-
export
|
|
4
|
+
export type { HazoAuthUser, HazoAuthResult, HazoAuthError, HazoAuthOptions, ScopeDetails, TenantOrganization, TenantAuthOptions, TenantAuthResult, RequiredTenantAuthResult, } from "./lib/auth/auth_types";
|
|
5
|
+
export { AuthenticationRequiredError, TenantRequiredError, TenantAccessDeniedError, } from "./lib/auth/auth_types.js";
|
|
6
|
+
export { cn, merge_class_names } from "./lib/utils.js";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAG5C,cAAc,oBAAoB,CAAC;AAGnC,YAAY,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
// file_description: main entry point for hazo_auth package - exports
|
|
1
|
+
// file_description: main entry point for hazo_auth package - client-safe exports only
|
|
2
|
+
// This entry point is safe for use in client components (browser)
|
|
3
|
+
// For server-side code, use "hazo_auth/server-lib" instead
|
|
4
|
+
//
|
|
5
|
+
// BREAKING CHANGE (v5.2.0): Server-only exports moved to "hazo_auth/server-lib"
|
|
6
|
+
// Migration: import { hazo_get_auth, get_login_config } from "hazo_auth/server-lib";
|
|
2
7
|
// section: context_exports
|
|
3
8
|
export * from "./contexts/hazo_auth_provider.js";
|
|
4
9
|
export * from "./contexts/hazo_auth_config.js";
|
|
5
10
|
// section: component_exports
|
|
6
11
|
export * from "./components/index.js";
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
export { AuthenticationRequiredError, TenantRequiredError, TenantAccessDeniedError, } from "./lib/auth/auth_types.js";
|
|
13
|
+
// section: utility_exports (client-safe)
|
|
14
|
+
export { cn, merge_class_names } from "./lib/utils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"already_logged_in_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/already_logged_in_config.server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"already_logged_in_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/already_logged_in_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAMrB,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,qBAAqB,CAyBpE"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// file_description: server-only helper to read already logged in configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
2
4
|
// section: imports
|
|
3
5
|
import { get_config_value, get_config_boolean } from "./config/config_loader.server.js";
|
|
4
6
|
// section: helpers
|
package/dist/lib/app_logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_logger.d.ts","sourceRoot":"","sources":["../../src/lib/app_logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app_logger.d.ts","sourceRoot":"","sources":["../../src/lib/app_logger.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kCAAe,CAAC"}
|
package/dist/lib/app_logger.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
// file_description:
|
|
1
|
+
// file_description: server-only wrapper for the main app logging service using hazo_logs
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
2
4
|
// section: imports
|
|
3
5
|
import { createLogger } from "hazo_logs";
|
|
4
6
|
// section: logger_instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_permissions_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/app_permissions_config.server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app_permissions_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/app_permissions_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAAC;AAIF;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,oBAAoB,CA0BjE;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,SAAS,CAGpB;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,gBAAgB,EAAE,MAAM,EAAE,GACzB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAYrB"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// file_description: server-only helper to read app permissions configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
2
4
|
// This allows consuming apps to declare their required permissions with descriptions for debugging
|
|
3
5
|
// section: imports
|
|
4
6
|
import { read_config_section } from "./config/config_loader.server.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_user_data_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/app_user_data_config.server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app_user_data_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/app_user_data_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAYrB;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,+DAA+D;IAC/D,aAAa,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,kEAAkE;IAClE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,CAAC;AAkEF;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,iBAAiB,CAU5D;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,iBAAiB,GAAG,IAAI,CAGnE;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,OAAO,CAGzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAarD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAwBxE"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// file_description: server-only helper to read app_user_data schema configuration from hazo_auth_config.ini
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
2
4
|
// Enables schema-based editing of app_user_data in User Management
|
|
3
5
|
// section: imports
|
|
4
6
|
import { get_config_value, get_config_boolean, read_config_section, } from "./config/config_loader.server.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_utils.server.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/auth_utils.server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOxD,MAAM,MAAM,QAAQ,GAAG;IACrB,aAAa,EAAE,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR;IAAE,aAAa,EAAE,KAAK,CAAA;CAAE,CAAC;AAmB7B;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA8CtF;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAG7E;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAQ1E;AAED;;;;;GAKG;AACH,wBAAsB,oCAAoC,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC;IACxF,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,CAAC,CA6DD"}
|
|
1
|
+
{"version":3,"file":"auth_utils.server.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/auth_utils.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOxD,MAAM,MAAM,QAAQ,GAAG;IACrB,aAAa,EAAE,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR;IAAE,aAAa,EAAE,KAAK,CAAA;CAAE,CAAC;AAmB7B;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA8CtF;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAG7E;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAQ1E;AAED;;;;;GAKG;AACH,wBAAsB,oCAAoC,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC;IACxF,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,CAAC,CA6DD"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// file_description: server-side authentication utilities for checking login status in API routes
|
|
2
|
+
// section: server-only-guard
|
|
3
|
+
import "server-only";
|
|
2
4
|
// section: imports
|
|
3
5
|
import { NextResponse } from "next/server";
|
|
4
6
|
import { get_hazo_connect_instance } from "../hazo_connect_instance.server.js";
|