hazo_auth 10.31.0 → 10.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-src/lib/auth/deny_permission.server.ts +10 -7
- package/cli-src/lib/auth/with_permission_issue_capture.server.ts +5 -3
- package/cli-src/lib/auth_hooks.ts +19 -5
- package/cli-src/lib/hazo_connect_instance.server.ts +46 -15
- package/cli-src/lib/services/email_service.ts +17 -2
- package/dist/admin-issues/plugin.server.js +1 -1
- package/dist/lib/auth/deny_permission.server.d.ts.map +1 -1
- package/dist/lib/auth/deny_permission.server.js +7 -4
- package/dist/lib/auth/with_permission_issue_capture.server.d.ts.map +1 -1
- package/dist/lib/auth/with_permission_issue_capture.server.js +4 -2
- package/dist/lib/auth_hooks.d.ts.map +1 -1
- package/dist/lib/auth_hooks.js +19 -5
- package/dist/lib/hazo_connect_instance.server.d.ts.map +1 -1
- package/dist/lib/hazo_connect_instance.server.js +37 -12
- package/dist/lib/services/email_service.d.ts.map +1 -1
- package/dist/lib/services/email_service.js +17 -2
- package/dist/server/routes/detect_proxy_origin.d.ts +6 -0
- package/dist/server/routes/detect_proxy_origin.d.ts.map +1 -0
- package/dist/server/routes/detect_proxy_origin.js +49 -0
- package/dist/server/routes/nextauth.d.ts.map +1 -1
- package/dist/server/routes/nextauth.js +1 -44
- package/dist/server/routes/user_management_users.d.ts +1 -1
- package/dist/server-lib.d.ts +1 -0
- package/dist/server-lib.d.ts.map +1 -1
- package/dist/server-lib.js +7 -0
- package/dist/settings/index.d.ts +5 -0
- package/dist/settings/index.d.ts.map +1 -0
- package/dist/settings/index.js +161 -0
- package/package.json +17 -9
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// file_description: standalone helper to return a 403 FORBIDDEN response and fire the permission-denied handler
|
|
2
2
|
import 'server-only';
|
|
3
3
|
|
|
4
|
+
import { optional_import } from 'hazo_core';
|
|
4
5
|
import {
|
|
5
6
|
buildDenialPayloadFromRequest,
|
|
6
7
|
buildForbiddenResponse,
|
|
@@ -86,13 +87,15 @@ export function denyPermission(input: DenyPermissionInput): Response {
|
|
|
86
87
|
// Kick off async hazo_api enhancement but return the sync response immediately.
|
|
87
88
|
// The returned Response object is the sync fallback; hazo_api is decorative for
|
|
88
89
|
// middleware use cases that don't need the exact envelope.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
// optional_import (not a literal `import('hazo_api')`) — hazo_api is an
|
|
91
|
+
// optional peer; a literal dynamic import of an uninstalled package name
|
|
92
|
+
// fails Next.js/Turbopack's build-time static resolution even though the
|
|
93
|
+
// `.catch()` would have handled it fine at runtime.
|
|
94
|
+
void optional_import<{ fail?: (...args: unknown[]) => Response }>('hazo_api').then((m) => {
|
|
95
|
+
if (typeof m?.fail === 'function') {
|
|
96
|
+
// No-op: we already returned — this is a fire-and-forget; nothing to do with the result.
|
|
97
|
+
}
|
|
98
|
+
});
|
|
96
99
|
|
|
97
100
|
return new Response(bodyJson, {
|
|
98
101
|
status: 403,
|
|
@@ -4,7 +4,7 @@ import 'server-only';
|
|
|
4
4
|
|
|
5
5
|
// section: imports
|
|
6
6
|
import { type NextRequest } from 'next/server';
|
|
7
|
-
import { createLogger } from 'hazo_core';
|
|
7
|
+
import { createLogger, optional_import } from 'hazo_core';
|
|
8
8
|
import { PermissionError } from './auth_types.js';
|
|
9
9
|
import { hazo_get_auth } from './hazo_get_auth.server.js';
|
|
10
10
|
|
|
@@ -106,13 +106,15 @@ export function buildDenialPayloadFromRequest(
|
|
|
106
106
|
|
|
107
107
|
/** Builds the 403 Response, using hazo_api.fail() if available, otherwise hand-built. */
|
|
108
108
|
export async function buildForbiddenResponse(payload: PermissionDeniedPayload): Promise<Response> {
|
|
109
|
-
|
|
109
|
+
// optional_import, not a literal `import('hazo_api')` — see deny_permission.server.ts
|
|
110
|
+
// for why a literal dynamic import of this optional peer breaks Turbopack builds.
|
|
111
|
+
const apiMod = await optional_import<{
|
|
110
112
|
fail?: (
|
|
111
113
|
code: string,
|
|
112
114
|
message: string,
|
|
113
115
|
opts?: { details?: unknown; status?: number },
|
|
114
116
|
) => Response;
|
|
115
|
-
}
|
|
117
|
+
}>('hazo_api');
|
|
116
118
|
|
|
117
119
|
if (apiMod?.fail) {
|
|
118
120
|
return apiMod.fail('FORBIDDEN', payload.user_friendly_message, {
|
|
@@ -20,17 +20,31 @@ export interface AuthHooks {
|
|
|
20
20
|
// section: registry
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* Registry backed by globalThis (keyed by a well-known Symbol.for), not a plain
|
|
24
|
+
* module-level variable. A consuming Next.js app typically calls
|
|
25
|
+
* register_auth_hooks() once from instrumentation.ts and fire_auth_hook() from
|
|
26
|
+
* an API route — two separate entry points that a bundler (Next.js/Turbopack)
|
|
27
|
+
* can place in separate module graphs, each getting its own evaluation of this
|
|
28
|
+
* module. A plain `let _hooks` would then be two different objects, so a hook
|
|
29
|
+
* registered in one graph silently never fires in the other (no error, no log —
|
|
30
|
+
* fire_auth_hook's `if (!hook) return` no-ops cleanly). globalThis is the one
|
|
31
|
+
* thing shared across module graphs in the same process; Symbol.for interns the
|
|
32
|
+
* key so every graph's registry getter resolves to the same Map. Same pattern as
|
|
33
|
+
* hazo_central's registry (see hazo_central/src/registry/registry.ts).
|
|
25
34
|
*/
|
|
26
|
-
|
|
35
|
+
const HOOKS_KEY = Symbol.for('hazo_auth.auth_hooks');
|
|
36
|
+
|
|
37
|
+
function hooks_store(): AuthHooks {
|
|
38
|
+
const g = globalThis as unknown as Record<symbol, AuthHooks>;
|
|
39
|
+
return (g[HOOKS_KEY] ??= {});
|
|
40
|
+
}
|
|
27
41
|
|
|
28
42
|
/**
|
|
29
43
|
* Registers hooks. Additive merge — only overwrites the keys passed in, so
|
|
30
44
|
* multiple call sites can each register different hooks without clobbering each other.
|
|
31
45
|
*/
|
|
32
46
|
export function register_auth_hooks(hooks: AuthHooks): void {
|
|
33
|
-
|
|
47
|
+
Object.assign(hooks_store(), hooks);
|
|
34
48
|
}
|
|
35
49
|
|
|
36
50
|
/**
|
|
@@ -41,7 +55,7 @@ export async function fire_auth_hook<K extends keyof AuthHooks>(
|
|
|
41
55
|
name: K,
|
|
42
56
|
ctx: AuthHookContext,
|
|
43
57
|
): Promise<void> {
|
|
44
|
-
const hook =
|
|
58
|
+
const hook = hooks_store()[name];
|
|
45
59
|
if (!hook) return;
|
|
46
60
|
|
|
47
61
|
try {
|
|
@@ -14,8 +14,36 @@ import { initializeAdminService, getSqliteAdminService } from "hazo_connect/serv
|
|
|
14
14
|
import { create_app_logger } from "./app_logger.js";
|
|
15
15
|
|
|
16
16
|
// section: singleton_state
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Backed by globalThis (keyed by a well-known Symbol.for), not plain
|
|
19
|
+
* module-level variables. A consuming Next.js app typically calls
|
|
20
|
+
* set_hazo_connect_instance() once from instrumentation.ts (to inject its own
|
|
21
|
+
* Postgres-backed hazo_connect adapter, bypassing this package's INI-based
|
|
22
|
+
* sqlite/postgrest config) and get_hazo_connect_instance() later from an API
|
|
23
|
+
* route's hazo_get_auth() call — two separate entry points that a bundler
|
|
24
|
+
* (Next.js/Turbopack, especially in `next dev`) can place in separate module
|
|
25
|
+
* graphs, each getting its own evaluation of this module. Plain `let`s would
|
|
26
|
+
* then be two different variables: the injected instance set in one graph
|
|
27
|
+
* would be invisible in the other, get_hazo_connect_instance() would fall
|
|
28
|
+
* through to getHazoConnectSingleton()'s INI-config path (which throws
|
|
29
|
+
* "hazo_connect_singleton_failed" when the app deliberately has no
|
|
30
|
+
* [hazo_connect] config section), and every authenticated request would fail
|
|
31
|
+
* with a DB lookup error even though the singleton was injected correctly.
|
|
32
|
+
* globalThis is the one thing shared across module graphs in the same
|
|
33
|
+
* process; Symbol.for interns the key so every graph's accessor resolves to
|
|
34
|
+
* the same backing object. Same pattern as auth_hooks.ts's hook registry.
|
|
35
|
+
*/
|
|
36
|
+
const CONNECT_SINGLETON_KEY = Symbol.for('hazo_auth.hazo_connect_instance');
|
|
37
|
+
|
|
38
|
+
type ConnectSingletonState = {
|
|
39
|
+
instance: HazoConnectAdapter | null;
|
|
40
|
+
isInitialized: boolean;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function connect_singleton_store(): ConnectSingletonState {
|
|
44
|
+
const g = globalThis as unknown as Record<symbol, ConnectSingletonState>;
|
|
45
|
+
return (g[CONNECT_SINGLETON_KEY] ??= { instance: null, isInitialized: false });
|
|
46
|
+
}
|
|
19
47
|
|
|
20
48
|
// section: helpers
|
|
21
49
|
/**
|
|
@@ -33,8 +61,10 @@ let isInitialized = false;
|
|
|
33
61
|
* @returns The singleton HazoConnectAdapter instance
|
|
34
62
|
*/
|
|
35
63
|
export function get_hazo_connect_instance(): HazoConnectAdapter {
|
|
64
|
+
const state = connect_singleton_store();
|
|
65
|
+
|
|
36
66
|
// Honor test injection or cached fallback first
|
|
37
|
-
if (
|
|
67
|
+
if (state.instance) return state.instance;
|
|
38
68
|
// Use the new singleton API from hazo_connect
|
|
39
69
|
// This automatically handles:
|
|
40
70
|
// - Instance reuse
|
|
@@ -62,23 +92,23 @@ export function get_hazo_connect_instance(): HazoConnectAdapter {
|
|
|
62
92
|
error_stack: error instanceof Error ? error.stack : undefined,
|
|
63
93
|
note: "Falling back to manual singleton implementation",
|
|
64
94
|
});
|
|
65
|
-
|
|
95
|
+
|
|
66
96
|
// Fallback: Manual singleton implementation if new API fails
|
|
67
97
|
// This should not happen with the updated package, but kept for safety
|
|
68
|
-
if (!
|
|
98
|
+
if (!state.instance) {
|
|
69
99
|
// Get config options to determine database type
|
|
70
100
|
const config_options = get_hazo_connect_config_options();
|
|
71
101
|
const db_type = config_options.type;
|
|
72
|
-
|
|
102
|
+
|
|
73
103
|
// Only initialize SQLite admin service for SQLite databases
|
|
74
|
-
if (db_type === "sqlite" && !isInitialized) {
|
|
104
|
+
if (db_type === "sqlite" && !state.isInitialized) {
|
|
75
105
|
initializeAdminService({ enable_admin_ui: true });
|
|
76
|
-
isInitialized = true;
|
|
106
|
+
state.isInitialized = true;
|
|
77
107
|
}
|
|
78
|
-
|
|
108
|
+
|
|
79
109
|
// Create the adapter instance (reads from hazo_auth_config.ini)
|
|
80
110
|
// Note: Despite the name, this function supports both SQLite and PostgREST
|
|
81
|
-
|
|
111
|
+
state.instance = create_sqlite_hazo_connect_server();
|
|
82
112
|
|
|
83
113
|
// Note: Database migrations should be applied manually via SQLite Admin UI
|
|
84
114
|
// or through a separate migration script. The token_service has fallback
|
|
@@ -100,21 +130,22 @@ export function get_hazo_connect_instance(): HazoConnectAdapter {
|
|
|
100
130
|
}
|
|
101
131
|
}
|
|
102
132
|
}
|
|
103
|
-
|
|
104
|
-
return
|
|
133
|
+
|
|
134
|
+
return state.instance;
|
|
105
135
|
}
|
|
106
136
|
}
|
|
107
137
|
|
|
108
138
|
/** Inject a connect adapter for tests (mirrors set_hazo_connect_instance pattern). */
|
|
109
139
|
export function set_hazo_connect_instance(adapter: HazoConnectAdapter): void {
|
|
110
|
-
|
|
140
|
+
connect_singleton_store().instance = adapter;
|
|
111
141
|
setHazoConnectSingleton(adapter);
|
|
112
142
|
}
|
|
113
143
|
|
|
114
144
|
/** Reset the injected adapter (call in afterAll). */
|
|
115
145
|
export function reset_hazo_connect_instance(): void {
|
|
116
|
-
|
|
117
|
-
|
|
146
|
+
const state = connect_singleton_store();
|
|
147
|
+
state.instance = null;
|
|
148
|
+
state.isInitialized = false;
|
|
118
149
|
resetHazoConnectSingleton();
|
|
119
150
|
}
|
|
120
151
|
|
|
@@ -396,10 +396,25 @@ export async function send_template_email(
|
|
|
396
396
|
const from_name = await get_email_from_name(notify_config);
|
|
397
397
|
const subject = get_email_subject(template_type);
|
|
398
398
|
|
|
399
|
-
//
|
|
400
|
-
|
|
399
|
+
// A bare `await import("hazo_notify/template_manager")` here would keep
|
|
400
|
+
// hazo_notify optional at *runtime* (ESM dynamic import, caught by this
|
|
401
|
+
// function's own try/catch) but not at *build time*: Turbopack/webpack
|
|
402
|
+
// still statically resolve a literal-string dynamic import target and
|
|
403
|
+
// eagerly bundle its whole module graph, which fails the build outright
|
|
404
|
+
// for any consumer that has hazo_notify installed (even just for one
|
|
405
|
+
// subpath export) without also having every one of hazo_notify's own
|
|
406
|
+
// `template_manager` dependencies (handlebars, hazo_i18n,
|
|
407
|
+
// isomorphic-dompurify, …) installed. `optional_import` (same helper
|
|
408
|
+
// the two `hazo_notify/adapters/email` call sites above already use)
|
|
409
|
+
// carries the turbopackIgnore/webpackIgnore/@vite-ignore directives
|
|
410
|
+
// that make the bundler treat this as truly optional.
|
|
411
|
+
const notify_template_manager_module = await optional_import<typeof import("hazo_notify/template_manager")>(
|
|
401
412
|
"hazo_notify/template_manager"
|
|
402
413
|
);
|
|
414
|
+
if (!notify_template_manager_module) {
|
|
415
|
+
throw new Error("hazo_notify is not installed");
|
|
416
|
+
}
|
|
417
|
+
const { send_template_email: notify_send_template_email } = notify_template_manager_module;
|
|
403
418
|
|
|
404
419
|
const result = await notify_send_template_email(
|
|
405
420
|
{
|
|
@@ -4,7 +4,7 @@ import { createLogger } from 'hazo_core';
|
|
|
4
4
|
import { createPackageT } from 'hazo_core/i18n';
|
|
5
5
|
import { GLOBAL_ADMIN_PERMISSION } from '../lib/constants.js';
|
|
6
6
|
import { find_roles_with_permission } from '../lib/services/find_roles_with_permission.js';
|
|
7
|
-
import en from '../locales/en.json';
|
|
7
|
+
import en from '../locales/en.json' with { type: 'json' };
|
|
8
8
|
const log = createLogger('hazo_auth:auth-issues-plugin');
|
|
9
9
|
const t = createPackageT('hazo_auth', en);
|
|
10
10
|
export const authIssueTypeDef = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deny_permission.server.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/deny_permission.server.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"deny_permission.server.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/deny_permission.server.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;AAUrB,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,IAAI,EAAE,GAAG,CAAC;IACV,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,sCAAsC;IACtC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqBD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,QAAQ,CAyDnE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// file_description: standalone helper to return a 403 FORBIDDEN response and fire the permission-denied handler
|
|
2
2
|
import 'server-only';
|
|
3
|
+
import { optional_import } from 'hazo_core';
|
|
3
4
|
import { buildDenialPayloadFromRequest, getPermissionDeniedHandler, } from './with_permission_issue_capture.server.js';
|
|
4
5
|
function extractUserId(auth) {
|
|
5
6
|
var _a, _b;
|
|
@@ -52,13 +53,15 @@ export function denyPermission(input) {
|
|
|
52
53
|
// Kick off async hazo_api enhancement but return the sync response immediately.
|
|
53
54
|
// The returned Response object is the sync fallback; hazo_api is decorative for
|
|
54
55
|
// middleware use cases that don't need the exact envelope.
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
// optional_import (not a literal `import('hazo_api')`) — hazo_api is an
|
|
57
|
+
// optional peer; a literal dynamic import of an uninstalled package name
|
|
58
|
+
// fails Next.js/Turbopack's build-time static resolution even though the
|
|
59
|
+
// `.catch()` would have handled it fine at runtime.
|
|
60
|
+
void optional_import('hazo_api').then((m) => {
|
|
57
61
|
if (typeof (m === null || m === void 0 ? void 0 : m.fail) === 'function') {
|
|
58
62
|
// No-op: we already returned — this is a fire-and-forget; nothing to do with the result.
|
|
59
63
|
}
|
|
60
|
-
})
|
|
61
|
-
.catch(() => undefined);
|
|
64
|
+
});
|
|
62
65
|
return new Response(bodyJson, {
|
|
63
66
|
status: 403,
|
|
64
67
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with_permission_issue_capture.server.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/with_permission_issue_capture.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAS/C,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAUD,wBAAgB,0BAA0B,CACxC,EAAE,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC7D,IAAI,CAEN;AAED,wBAAgB,0BAA0B,eARN,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,SAUnF;AAID,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,uBAAuB,GAC7B,uBAAuB,CAoCzB;AAID,yFAAyF;AACzF,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"with_permission_issue_capture.server.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/with_permission_issue_capture.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAS/C,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAUD,wBAAgB,0BAA0B,CACxC,EAAE,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC7D,IAAI,CAEN;AAED,wBAAgB,0BAA0B,eARN,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,SAUnF;AAID,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,uBAAuB,GAC7B,uBAAuB,CAoCzB;AAID,yFAAyF;AACzF,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAwChG;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,EACpD,IAAI,EAAE;IAAE,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAAE,GACvC,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CA0D7C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// file_description: Route handler wrapper that catches PermissionError and returns a structured hazo_api fail() 403
|
|
2
2
|
// section: server-only-guard
|
|
3
3
|
import 'server-only';
|
|
4
|
-
import { createLogger } from 'hazo_core';
|
|
4
|
+
import { createLogger, optional_import } from 'hazo_core';
|
|
5
5
|
import { PermissionError } from './auth_types.js';
|
|
6
6
|
import { hazo_get_auth } from './hazo_get_auth.server.js';
|
|
7
7
|
const log = createLogger('hazo_auth:permission_capture');
|
|
@@ -56,7 +56,9 @@ export function buildDenialPayloadFromRequest(request, parts) {
|
|
|
56
56
|
// section: response_helper
|
|
57
57
|
/** Builds the 403 Response, using hazo_api.fail() if available, otherwise hand-built. */
|
|
58
58
|
export async function buildForbiddenResponse(payload) {
|
|
59
|
-
|
|
59
|
+
// optional_import, not a literal `import('hazo_api')` — see deny_permission.server.ts
|
|
60
|
+
// for why a literal dynamic import of this optional peer breaks Turbopack builds.
|
|
61
|
+
const apiMod = await optional_import('hazo_api');
|
|
60
62
|
if (apiMod === null || apiMod === void 0 ? void 0 : apiMod.fail) {
|
|
61
63
|
return apiMod.fail('FORBIDDEN', payload.user_friendly_message, {
|
|
62
64
|
status: 403,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_hooks.d.ts","sourceRoot":"","sources":["../../src/lib/auth_hooks.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAC;CACxD;AAED,MAAM,WAAW,SAAS;IACxB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D;
|
|
1
|
+
{"version":3,"file":"auth_hooks.d.ts","sourceRoot":"","sources":["../../src/lib/auth_hooks.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAC;CACxD;AAED,MAAM,WAAW,SAAS;IACxB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D;AAwBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAE1D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,MAAM,SAAS,EAC5D,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,IAAI,CAAC,CASf"}
|
package/dist/lib/auth_hooks.js
CHANGED
|
@@ -4,23 +4,37 @@ import { create_app_logger } from './app_logger.js';
|
|
|
4
4
|
const log = create_app_logger();
|
|
5
5
|
// section: registry
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Registry backed by globalThis (keyed by a well-known Symbol.for), not a plain
|
|
8
|
+
* module-level variable. A consuming Next.js app typically calls
|
|
9
|
+
* register_auth_hooks() once from instrumentation.ts and fire_auth_hook() from
|
|
10
|
+
* an API route — two separate entry points that a bundler (Next.js/Turbopack)
|
|
11
|
+
* can place in separate module graphs, each getting its own evaluation of this
|
|
12
|
+
* module. A plain `let _hooks` would then be two different objects, so a hook
|
|
13
|
+
* registered in one graph silently never fires in the other (no error, no log —
|
|
14
|
+
* fire_auth_hook's `if (!hook) return` no-ops cleanly). globalThis is the one
|
|
15
|
+
* thing shared across module graphs in the same process; Symbol.for interns the
|
|
16
|
+
* key so every graph's registry getter resolves to the same Map. Same pattern as
|
|
17
|
+
* hazo_central's registry (see hazo_central/src/registry/registry.ts).
|
|
9
18
|
*/
|
|
10
|
-
|
|
19
|
+
const HOOKS_KEY = Symbol.for('hazo_auth.auth_hooks');
|
|
20
|
+
function hooks_store() {
|
|
21
|
+
var _a;
|
|
22
|
+
const g = globalThis;
|
|
23
|
+
return ((_a = g[HOOKS_KEY]) !== null && _a !== void 0 ? _a : (g[HOOKS_KEY] = {}));
|
|
24
|
+
}
|
|
11
25
|
/**
|
|
12
26
|
* Registers hooks. Additive merge — only overwrites the keys passed in, so
|
|
13
27
|
* multiple call sites can each register different hooks without clobbering each other.
|
|
14
28
|
*/
|
|
15
29
|
export function register_auth_hooks(hooks) {
|
|
16
|
-
|
|
30
|
+
Object.assign(hooks_store(), hooks);
|
|
17
31
|
}
|
|
18
32
|
/**
|
|
19
33
|
* Fires a registered hook by name, best-effort. Never throws or rejects to the
|
|
20
34
|
* caller — signup must succeed even if the hook fails.
|
|
21
35
|
*/
|
|
22
36
|
export async function fire_auth_hook(name, ctx) {
|
|
23
|
-
const hook =
|
|
37
|
+
const hook = hooks_store()[name];
|
|
24
38
|
if (!hook)
|
|
25
39
|
return;
|
|
26
40
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hazo_connect_instance.server.d.ts","sourceRoot":"","sources":["../../src/lib/hazo_connect_instance.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAMrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"hazo_connect_instance.server.d.ts","sourceRoot":"","sources":["../../src/lib/hazo_connect_instance.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAMrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAwCvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,IAAI,kBAAkB,CAyE9D;AAED,sFAAsF;AACtF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAG3E;AAED,qDAAqD;AACrD,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD"}
|
|
@@ -7,8 +7,31 @@ import { create_sqlite_hazo_connect_server, get_hazo_connect_config_options } fr
|
|
|
7
7
|
import { initializeAdminService, getSqliteAdminService } from "hazo_connect/server";
|
|
8
8
|
import { create_app_logger } from "./app_logger.js";
|
|
9
9
|
// section: singleton_state
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Backed by globalThis (keyed by a well-known Symbol.for), not plain
|
|
12
|
+
* module-level variables. A consuming Next.js app typically calls
|
|
13
|
+
* set_hazo_connect_instance() once from instrumentation.ts (to inject its own
|
|
14
|
+
* Postgres-backed hazo_connect adapter, bypassing this package's INI-based
|
|
15
|
+
* sqlite/postgrest config) and get_hazo_connect_instance() later from an API
|
|
16
|
+
* route's hazo_get_auth() call — two separate entry points that a bundler
|
|
17
|
+
* (Next.js/Turbopack, especially in `next dev`) can place in separate module
|
|
18
|
+
* graphs, each getting its own evaluation of this module. Plain `let`s would
|
|
19
|
+
* then be two different variables: the injected instance set in one graph
|
|
20
|
+
* would be invisible in the other, get_hazo_connect_instance() would fall
|
|
21
|
+
* through to getHazoConnectSingleton()'s INI-config path (which throws
|
|
22
|
+
* "hazo_connect_singleton_failed" when the app deliberately has no
|
|
23
|
+
* [hazo_connect] config section), and every authenticated request would fail
|
|
24
|
+
* with a DB lookup error even though the singleton was injected correctly.
|
|
25
|
+
* globalThis is the one thing shared across module graphs in the same
|
|
26
|
+
* process; Symbol.for interns the key so every graph's accessor resolves to
|
|
27
|
+
* the same backing object. Same pattern as auth_hooks.ts's hook registry.
|
|
28
|
+
*/
|
|
29
|
+
const CONNECT_SINGLETON_KEY = Symbol.for('hazo_auth.hazo_connect_instance');
|
|
30
|
+
function connect_singleton_store() {
|
|
31
|
+
var _a;
|
|
32
|
+
const g = globalThis;
|
|
33
|
+
return ((_a = g[CONNECT_SINGLETON_KEY]) !== null && _a !== void 0 ? _a : (g[CONNECT_SINGLETON_KEY] = { instance: null, isInitialized: false }));
|
|
34
|
+
}
|
|
12
35
|
// section: helpers
|
|
13
36
|
/**
|
|
14
37
|
* Gets or creates the singleton hazo_connect adapter instance
|
|
@@ -25,9 +48,10 @@ let isInitialized = false;
|
|
|
25
48
|
* @returns The singleton HazoConnectAdapter instance
|
|
26
49
|
*/
|
|
27
50
|
export function get_hazo_connect_instance() {
|
|
51
|
+
const state = connect_singleton_store();
|
|
28
52
|
// Honor test injection or cached fallback first
|
|
29
|
-
if (
|
|
30
|
-
return
|
|
53
|
+
if (state.instance)
|
|
54
|
+
return state.instance;
|
|
31
55
|
// Use the new singleton API from hazo_connect
|
|
32
56
|
// This automatically handles:
|
|
33
57
|
// - Instance reuse
|
|
@@ -58,18 +82,18 @@ export function get_hazo_connect_instance() {
|
|
|
58
82
|
});
|
|
59
83
|
// Fallback: Manual singleton implementation if new API fails
|
|
60
84
|
// This should not happen with the updated package, but kept for safety
|
|
61
|
-
if (!
|
|
85
|
+
if (!state.instance) {
|
|
62
86
|
// Get config options to determine database type
|
|
63
87
|
const config_options = get_hazo_connect_config_options();
|
|
64
88
|
const db_type = config_options.type;
|
|
65
89
|
// Only initialize SQLite admin service for SQLite databases
|
|
66
|
-
if (db_type === "sqlite" && !isInitialized) {
|
|
90
|
+
if (db_type === "sqlite" && !state.isInitialized) {
|
|
67
91
|
initializeAdminService({ enable_admin_ui: true });
|
|
68
|
-
isInitialized = true;
|
|
92
|
+
state.isInitialized = true;
|
|
69
93
|
}
|
|
70
94
|
// Create the adapter instance (reads from hazo_auth_config.ini)
|
|
71
95
|
// Note: Despite the name, this function supports both SQLite and PostgREST
|
|
72
|
-
|
|
96
|
+
state.instance = create_sqlite_hazo_connect_server();
|
|
73
97
|
// Note: Database migrations should be applied manually via SQLite Admin UI
|
|
74
98
|
// or through a separate migration script. The token_service has fallback
|
|
75
99
|
// logic to work without the token_type column if migration hasn't been applied.
|
|
@@ -90,17 +114,18 @@ export function get_hazo_connect_instance() {
|
|
|
90
114
|
}
|
|
91
115
|
}
|
|
92
116
|
}
|
|
93
|
-
return
|
|
117
|
+
return state.instance;
|
|
94
118
|
}
|
|
95
119
|
}
|
|
96
120
|
/** Inject a connect adapter for tests (mirrors set_hazo_connect_instance pattern). */
|
|
97
121
|
export function set_hazo_connect_instance(adapter) {
|
|
98
|
-
|
|
122
|
+
connect_singleton_store().instance = adapter;
|
|
99
123
|
setHazoConnectSingleton(adapter);
|
|
100
124
|
}
|
|
101
125
|
/** Reset the injected adapter (call in afterAll). */
|
|
102
126
|
export function reset_hazo_connect_instance() {
|
|
103
|
-
|
|
104
|
-
|
|
127
|
+
const state = connect_singleton_store();
|
|
128
|
+
state.instance = null;
|
|
129
|
+
state.isInitialized = false;
|
|
105
130
|
resetHazoConnectSingleton();
|
|
106
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/email_service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,4BAA4B,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAElH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AAiBF;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAE3E;AAmMD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA4ErG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,iBAAiB,EAChC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,iBAAiB,EACvB,iBAAiB,CAAC,EAAE,MAAM,GACzB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"email_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/email_service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,4BAA4B,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAElH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AAiBF;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAE3E;AAmMD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA4ErG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,iBAAiB,EAChC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,iBAAiB,EACvB,iBAAiB,CAAC,EAAE,MAAM,GACzB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA4G/C"}
|
|
@@ -328,8 +328,23 @@ export async function send_template_email(template_type, to, data, recipient_use
|
|
|
328
328
|
const from = await get_email_from(notify_config);
|
|
329
329
|
const from_name = await get_email_from_name(notify_config);
|
|
330
330
|
const subject = get_email_subject(template_type);
|
|
331
|
-
//
|
|
332
|
-
|
|
331
|
+
// A bare `await import("hazo_notify/template_manager")` here would keep
|
|
332
|
+
// hazo_notify optional at *runtime* (ESM dynamic import, caught by this
|
|
333
|
+
// function's own try/catch) but not at *build time*: Turbopack/webpack
|
|
334
|
+
// still statically resolve a literal-string dynamic import target and
|
|
335
|
+
// eagerly bundle its whole module graph, which fails the build outright
|
|
336
|
+
// for any consumer that has hazo_notify installed (even just for one
|
|
337
|
+
// subpath export) without also having every one of hazo_notify's own
|
|
338
|
+
// `template_manager` dependencies (handlebars, hazo_i18n,
|
|
339
|
+
// isomorphic-dompurify, …) installed. `optional_import` (same helper
|
|
340
|
+
// the two `hazo_notify/adapters/email` call sites above already use)
|
|
341
|
+
// carries the turbopackIgnore/webpackIgnore/@vite-ignore directives
|
|
342
|
+
// that make the bundler treat this as truly optional.
|
|
343
|
+
const notify_template_manager_module = await optional_import("hazo_notify/template_manager");
|
|
344
|
+
if (!notify_template_manager_module) {
|
|
345
|
+
throw new Error("hazo_notify is not installed");
|
|
346
|
+
}
|
|
347
|
+
const { send_template_email: notify_send_template_email } = notify_template_manager_module;
|
|
333
348
|
const result = await notify_send_template_email(Object.assign({ template_name: template_type, to,
|
|
334
349
|
variables, scope_id: null, subject,
|
|
335
350
|
from,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects the public-facing origin from request headers.
|
|
3
|
+
* Cloudflare tunnel sends: x-forwarded-host, x-forwarded-proto, cf-visitor, host
|
|
4
|
+
*/
|
|
5
|
+
export declare function detect_proxy_origin(request: Request): string | null;
|
|
6
|
+
//# sourceMappingURL=detect_proxy_origin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect_proxy_origin.d.ts","sourceRoot":"","sources":["../../../src/server/routes/detect_proxy_origin.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CA6CnE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// file_description: public-facing origin detection for requests behind a reverse proxy/tunnel
|
|
2
|
+
// section: proxy_detection
|
|
3
|
+
/**
|
|
4
|
+
* Detects the public-facing origin from request headers.
|
|
5
|
+
* Cloudflare tunnel sends: x-forwarded-host, x-forwarded-proto, cf-visitor, host
|
|
6
|
+
*/
|
|
7
|
+
export function detect_proxy_origin(request) {
|
|
8
|
+
try {
|
|
9
|
+
const request_url = new URL(request.url);
|
|
10
|
+
const forwarded_host = request.headers.get("x-forwarded-host");
|
|
11
|
+
const host_header = request.headers.get("host");
|
|
12
|
+
const forwarded_proto = request.headers.get("x-forwarded-proto") || "https";
|
|
13
|
+
// Debug logging in development
|
|
14
|
+
if (process.env.NODE_ENV === "development") {
|
|
15
|
+
console.log("[NextAuth Proxy] request.url:", request.url);
|
|
16
|
+
console.log("[NextAuth Proxy] request_url.hostname:", request_url.hostname, "request_url.host:", request_url.host);
|
|
17
|
+
console.log("[NextAuth Proxy] x-forwarded-host:", forwarded_host);
|
|
18
|
+
console.log("[NextAuth Proxy] host header:", host_header);
|
|
19
|
+
console.log("[NextAuth Proxy] x-forwarded-proto:", forwarded_proto);
|
|
20
|
+
}
|
|
21
|
+
// Check x-forwarded-host first (set by Cloudflare tunnel, nginx, etc.)
|
|
22
|
+
// Compared against request_url.host (host:port), not .hostname (host only) —
|
|
23
|
+
// Next.js's own dev server sets x-forwarded-host to "host:port" on every
|
|
24
|
+
// request, which never matches a bare hostname and used to false-positive
|
|
25
|
+
// as a proxy on plain localhost dev, corrupting NEXTAUTH_URL.
|
|
26
|
+
if (forwarded_host && forwarded_host !== request_url.host) {
|
|
27
|
+
const origin = `${forwarded_proto}://${forwarded_host}`;
|
|
28
|
+
if (process.env.NODE_ENV === "development") {
|
|
29
|
+
console.log("[NextAuth Proxy] Detected proxy via x-forwarded-host:", origin);
|
|
30
|
+
}
|
|
31
|
+
return origin;
|
|
32
|
+
}
|
|
33
|
+
// Check host header (Cloudflare tunnel also sets this to the tunnel domain)
|
|
34
|
+
if (host_header && host_header !== request_url.host) {
|
|
35
|
+
const origin = `${forwarded_proto}://${host_header}`;
|
|
36
|
+
if (process.env.NODE_ENV === "development") {
|
|
37
|
+
console.log("[NextAuth Proxy] Detected proxy via host header:", origin);
|
|
38
|
+
}
|
|
39
|
+
return origin;
|
|
40
|
+
}
|
|
41
|
+
if (process.env.NODE_ENV === "development") {
|
|
42
|
+
console.log("[NextAuth Proxy] No proxy detected");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
console.error("[NextAuth Proxy] Error:", e);
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextauth.d.ts","sourceRoot":"","sources":["../../../src/server/routes/nextauth.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"nextauth.d.ts","sourceRoot":"","sources":["../../../src/server/routes/nextauth.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CACzC,CAAC;AAyDF,wBAAsB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,gBAEvE;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,gBAExE"}
|
|
@@ -4,50 +4,7 @@
|
|
|
4
4
|
import NextAuthImport from "next-auth";
|
|
5
5
|
const NextAuth = NextAuthImport.default || NextAuthImport;
|
|
6
6
|
import { get_nextauth_config } from "../../lib/auth/nextauth_config.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Detects the public-facing origin from request headers.
|
|
10
|
-
* Cloudflare tunnel sends: x-forwarded-host, x-forwarded-proto, cf-visitor, host
|
|
11
|
-
*/
|
|
12
|
-
function detect_proxy_origin(request) {
|
|
13
|
-
try {
|
|
14
|
-
const request_url = new URL(request.url);
|
|
15
|
-
const forwarded_host = request.headers.get("x-forwarded-host");
|
|
16
|
-
const host_header = request.headers.get("host");
|
|
17
|
-
const forwarded_proto = request.headers.get("x-forwarded-proto") || "https";
|
|
18
|
-
// Debug logging in development
|
|
19
|
-
if (process.env.NODE_ENV === "development") {
|
|
20
|
-
console.log("[NextAuth Proxy] request.url:", request.url);
|
|
21
|
-
console.log("[NextAuth Proxy] request_url.hostname:", request_url.hostname, "request_url.host:", request_url.host);
|
|
22
|
-
console.log("[NextAuth Proxy] x-forwarded-host:", forwarded_host);
|
|
23
|
-
console.log("[NextAuth Proxy] host header:", host_header);
|
|
24
|
-
console.log("[NextAuth Proxy] x-forwarded-proto:", forwarded_proto);
|
|
25
|
-
}
|
|
26
|
-
// Check x-forwarded-host first (set by Cloudflare tunnel, nginx, etc.)
|
|
27
|
-
if (forwarded_host && forwarded_host !== request_url.hostname) {
|
|
28
|
-
const origin = `${forwarded_proto}://${forwarded_host}`;
|
|
29
|
-
if (process.env.NODE_ENV === "development") {
|
|
30
|
-
console.log("[NextAuth Proxy] Detected proxy via x-forwarded-host:", origin);
|
|
31
|
-
}
|
|
32
|
-
return origin;
|
|
33
|
-
}
|
|
34
|
-
// Check host header (Cloudflare tunnel also sets this to the tunnel domain)
|
|
35
|
-
if (host_header && host_header !== request_url.host) {
|
|
36
|
-
const origin = `${forwarded_proto}://${host_header}`;
|
|
37
|
-
if (process.env.NODE_ENV === "development") {
|
|
38
|
-
console.log("[NextAuth Proxy] Detected proxy via host header:", origin);
|
|
39
|
-
}
|
|
40
|
-
return origin;
|
|
41
|
-
}
|
|
42
|
-
if (process.env.NODE_ENV === "development") {
|
|
43
|
-
console.log("[NextAuth Proxy] No proxy detected");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
console.error("[NextAuth Proxy] Error:", e);
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
7
|
+
import { detect_proxy_origin } from "./detect_proxy_origin.js";
|
|
51
8
|
// section: handler
|
|
52
9
|
/**
|
|
53
10
|
* Handles NextAuth requests with proxy/tunnel support.
|
|
@@ -26,7 +26,7 @@ export declare function GET(request: NextRequest): Promise<NextResponse<{
|
|
|
26
26
|
profile_source: {} | null;
|
|
27
27
|
user_type: string | null;
|
|
28
28
|
app_user_data: Record<string, unknown> | null;
|
|
29
|
-
legal_acceptance_status: "current" | "
|
|
29
|
+
legal_acceptance_status: "current" | "none" | "outdated";
|
|
30
30
|
}[];
|
|
31
31
|
}>>;
|
|
32
32
|
/**
|
package/dist/server-lib.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
export * from "./lib/auth/index.js";
|
|
3
|
+
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS, GLOBAL_ADMIN_PERMISSION } from "./lib/constants.js";
|
|
3
4
|
export { register_auth_hooks, fire_auth_hook } from "./lib/auth_hooks.js";
|
|
4
5
|
export type { AuthHooks, AuthHookContext } from "./lib/auth_hooks";
|
|
5
6
|
export * from "./lib/services/index.js";
|
package/dist/server-lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-lib.d.ts","sourceRoot":"","sources":["../src/server-lib.ts"],"names":[],"mappings":"AAYA,OAAO,aAAa,CAAC;AAGrB,cAAc,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"server-lib.d.ts","sourceRoot":"","sources":["../src/server-lib.ts"],"names":[],"mappings":"AAYA,OAAO,aAAa,CAAC;AAGrB,cAAc,kBAAkB,CAAC;AAQjC,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAGxG,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnE,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAGrF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,YAAY,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAG9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,YAAY,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAGpF,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,YAAY,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAG9F,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAK7E,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,YAAY,EACV,oBAAoB,EACpB,cAAc,EACd,eAAe,GAChB,MAAM,8BAA8B,CAAC"}
|
package/dist/server-lib.js
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
import "server-only";
|
|
13
13
|
// section: auth_exports
|
|
14
14
|
export * from "./lib/auth/index.js";
|
|
15
|
+
// section: constant_exports
|
|
16
|
+
// Zero-dependency string constants — exported here (not just from the root
|
|
17
|
+
// `hazo_auth` / `hazo_auth/client` entries) so server code that only needs
|
|
18
|
+
// e.g. GLOBAL_ADMIN_PERMISSION isn't forced to pull in the root entry's
|
|
19
|
+
// component tree (hazo_ui, @uiw/react-md-editor, its .css import) just to
|
|
20
|
+
// read a string.
|
|
21
|
+
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS, GLOBAL_ADMIN_PERMISSION } from "./lib/constants.js";
|
|
15
22
|
// section: auth_hooks_exports
|
|
16
23
|
export { register_auth_hooks, fire_auth_hook } from "./lib/auth_hooks.js";
|
|
17
24
|
// section: service_exports
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SettingCategorySchema } from 'hazo_config/lib';
|
|
2
|
+
export declare const authSettingsSchema: SettingCategorySchema;
|
|
3
|
+
/** All setting categories this package contributes -- read by `loadBuiltinSchemas()`. */
|
|
4
|
+
export declare const categories: SettingCategorySchema[];
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/settings/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,eAAO,MAAM,kBAAkB,EAAE,qBAyJhC,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,UAAU,EAAE,qBAAqB,EAAyB,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Purpose: Declares the `SettingCategorySchema` hazo_auth contributes to the
|
|
2
|
+
// platform settings dashboard (see `hazo_config/lib`). Type-only dependency
|
|
3
|
+
// on hazo_config -- no runtime import, so no new peer/runtime dependency is
|
|
4
|
+
// introduced by this file. Loaded dynamically by hazo_config's
|
|
5
|
+
// `loadBuiltinSchemas()` via the `hazo_auth/settings` subpath export.
|
|
6
|
+
export const authSettingsSchema = {
|
|
7
|
+
id: 'auth',
|
|
8
|
+
label: 'Authentication & Users',
|
|
9
|
+
package: 'hazo_auth',
|
|
10
|
+
sort_order: 10,
|
|
11
|
+
tabs: [
|
|
12
|
+
{
|
|
13
|
+
id: 'security',
|
|
14
|
+
label: 'Security',
|
|
15
|
+
fields: [
|
|
16
|
+
{
|
|
17
|
+
key: 'min_password_length',
|
|
18
|
+
type: 'number',
|
|
19
|
+
label: 'Minimum Password Length',
|
|
20
|
+
default: 8,
|
|
21
|
+
tier: 'platform',
|
|
22
|
+
ini_section: 'auth',
|
|
23
|
+
ini_key: 'min_password_length',
|
|
24
|
+
db_section: 'auth.security',
|
|
25
|
+
ui_hint: { min: 4, max: 64 },
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: 'token_expiry_hours',
|
|
29
|
+
type: 'number',
|
|
30
|
+
label: 'Token Expiry (hours)',
|
|
31
|
+
default: 24,
|
|
32
|
+
tier: 'platform',
|
|
33
|
+
ini_section: 'auth',
|
|
34
|
+
ini_key: 'token_expiry_hours',
|
|
35
|
+
db_section: 'auth.security',
|
|
36
|
+
ui_hint: { min: 1 },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: 'max_login_attempts',
|
|
40
|
+
type: 'number',
|
|
41
|
+
label: 'Max Login Attempts',
|
|
42
|
+
default: 5,
|
|
43
|
+
tier: 'platform',
|
|
44
|
+
ini_section: 'auth',
|
|
45
|
+
ini_key: 'max_login_attempts',
|
|
46
|
+
db_section: 'auth.security',
|
|
47
|
+
ui_hint: { min: 1 },
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: 'lockout_duration_min',
|
|
51
|
+
type: 'number',
|
|
52
|
+
label: 'Lockout Duration (minutes)',
|
|
53
|
+
default: 15,
|
|
54
|
+
tier: 'platform',
|
|
55
|
+
ini_section: 'auth',
|
|
56
|
+
ini_key: 'lockout_duration_min',
|
|
57
|
+
db_section: 'auth.security',
|
|
58
|
+
ui_hint: { min: 1 },
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'branding',
|
|
64
|
+
label: 'Branding',
|
|
65
|
+
fields: [
|
|
66
|
+
{
|
|
67
|
+
key: 'login_heading',
|
|
68
|
+
type: 'string',
|
|
69
|
+
label: 'Login Heading',
|
|
70
|
+
default: 'Welcome back',
|
|
71
|
+
tier: 'both',
|
|
72
|
+
db_section: 'auth.branding',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: 'button_primary_color',
|
|
76
|
+
type: 'color',
|
|
77
|
+
label: 'Primary Button Color',
|
|
78
|
+
default: '#2563eb',
|
|
79
|
+
tier: 'both',
|
|
80
|
+
db_section: 'auth.branding',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: 'button_accent_color',
|
|
84
|
+
type: 'color',
|
|
85
|
+
label: 'Accent Button Color',
|
|
86
|
+
default: '#1d4ed8',
|
|
87
|
+
tier: 'both',
|
|
88
|
+
db_section: 'auth.branding',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: 'navbar_logo',
|
|
92
|
+
type: 'file',
|
|
93
|
+
label: 'Navbar Logo',
|
|
94
|
+
tier: 'both',
|
|
95
|
+
db_section: 'auth.branding',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'features',
|
|
101
|
+
label: 'Features',
|
|
102
|
+
fields: [
|
|
103
|
+
{
|
|
104
|
+
key: 'enable_google_oauth',
|
|
105
|
+
type: 'boolean',
|
|
106
|
+
label: 'Enable Google OAuth',
|
|
107
|
+
default: true,
|
|
108
|
+
tier: 'platform',
|
|
109
|
+
ini_section: 'auth',
|
|
110
|
+
ini_key: 'enable_google_oauth',
|
|
111
|
+
db_section: 'auth.features',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
key: 'enable_email_auth',
|
|
115
|
+
type: 'boolean',
|
|
116
|
+
label: 'Enable Email / Password Auth',
|
|
117
|
+
default: true,
|
|
118
|
+
tier: 'platform',
|
|
119
|
+
ini_section: 'auth',
|
|
120
|
+
ini_key: 'enable_email_auth',
|
|
121
|
+
db_section: 'auth.features',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: 'enable_otp',
|
|
125
|
+
type: 'boolean',
|
|
126
|
+
label: 'Enable One-Time Passcodes',
|
|
127
|
+
default: false,
|
|
128
|
+
tier: 'platform',
|
|
129
|
+
ini_section: 'auth',
|
|
130
|
+
ini_key: 'enable_otp',
|
|
131
|
+
db_section: 'auth.features',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'email',
|
|
137
|
+
label: 'Email',
|
|
138
|
+
fields: [
|
|
139
|
+
{
|
|
140
|
+
key: 'auth_from_email',
|
|
141
|
+
type: 'string',
|
|
142
|
+
label: 'From Email',
|
|
143
|
+
description: 'Sender address used for auth-related emails (verification, password reset, OTP).',
|
|
144
|
+
default: '',
|
|
145
|
+
tier: 'scope',
|
|
146
|
+
db_section: 'auth.email',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: 'auth_from_name',
|
|
150
|
+
type: 'string',
|
|
151
|
+
label: 'From Name',
|
|
152
|
+
default: '',
|
|
153
|
+
tier: 'scope',
|
|
154
|
+
db_section: 'auth.email',
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
/** All setting categories this package contributes -- read by `loadBuiltinSchemas()`. */
|
|
161
|
+
export const categories = [authSettingsSchema];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_auth",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.32.1",
|
|
4
4
|
"description": "Zero-config authentication UI components for Next.js with RBAC, OAuth, scope-based multi-tenancy, and invitations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -106,6 +106,10 @@
|
|
|
106
106
|
"types": "./dist/server/routes/index.d.ts",
|
|
107
107
|
"import": "./dist/server/routes/index.js"
|
|
108
108
|
},
|
|
109
|
+
"./server/routes/*": {
|
|
110
|
+
"types": "./dist/server/routes/*.d.ts",
|
|
111
|
+
"import": "./dist/server/routes/*.js"
|
|
112
|
+
},
|
|
109
113
|
"./server/middleware": {
|
|
110
114
|
"types": "./dist/server/middleware.d.ts",
|
|
111
115
|
"import": "./dist/server/middleware.js"
|
|
@@ -181,6 +185,10 @@
|
|
|
181
185
|
"./admin-issues-plugin/client": {
|
|
182
186
|
"types": "./dist/admin-issues/index.client.d.ts",
|
|
183
187
|
"import": "./dist/admin-issues/index.client.js"
|
|
188
|
+
},
|
|
189
|
+
"./settings": {
|
|
190
|
+
"types": "./dist/settings/index.d.ts",
|
|
191
|
+
"import": "./dist/settings/index.js"
|
|
184
192
|
}
|
|
185
193
|
},
|
|
186
194
|
"files": [
|
|
@@ -276,15 +284,15 @@
|
|
|
276
284
|
"multer": "^2.0.2"
|
|
277
285
|
},
|
|
278
286
|
"peerDependencies": {
|
|
279
|
-
"hazo_config": "^2.
|
|
287
|
+
"hazo_config": "^2.7.2",
|
|
280
288
|
"hazo_connect": "^4.3.5",
|
|
281
289
|
"hazo_core": "^2.5.0",
|
|
282
|
-
"hazo_i18n": "^0.
|
|
290
|
+
"hazo_i18n": "^0.17.0",
|
|
283
291
|
"hazo_logs": "^2.3.1",
|
|
284
|
-
"hazo_notify": "^7.
|
|
292
|
+
"hazo_notify": "^7.1.0",
|
|
285
293
|
"hazo_secure": "^1.9.1",
|
|
286
294
|
"hazo_theme": "^1.4.2",
|
|
287
|
-
"hazo_ui": "^6.
|
|
295
|
+
"hazo_ui": "^6.21.0",
|
|
288
296
|
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
289
297
|
"next-auth": "^4.24.0",
|
|
290
298
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -362,14 +370,14 @@
|
|
|
362
370
|
"eslint": "^9.39.1",
|
|
363
371
|
"eslint-config-next": "^16.0.4",
|
|
364
372
|
"eslint-plugin-storybook": "^10.0.6",
|
|
365
|
-
"hazo_api": "^2.
|
|
366
|
-
"hazo_config": "^2.
|
|
373
|
+
"hazo_api": "^2.10.0",
|
|
374
|
+
"hazo_config": "^2.7.2",
|
|
367
375
|
"hazo_connect": "^4.3.5",
|
|
368
376
|
"hazo_core": "^2.5.0",
|
|
369
377
|
"hazo_logs": "^2.3.1",
|
|
370
|
-
"hazo_notify": "^7.
|
|
378
|
+
"hazo_notify": "^7.1.0",
|
|
371
379
|
"hazo_theme": "^1.4.2",
|
|
372
|
-
"hazo_ui": "^6.
|
|
380
|
+
"hazo_ui": "^6.21.0",
|
|
373
381
|
"input-otp": "^1.4.0",
|
|
374
382
|
"jest": "^30.2.0",
|
|
375
383
|
"jest-environment-jsdom": "^30.0.0",
|