hazo_auth 10.31.0 → 10.32.0
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_hooks.ts +19 -5
- package/dist/admin-issues/plugin.server.js +1 -1
- package/dist/lib/auth_hooks.d.ts.map +1 -1
- package/dist/lib/auth_hooks.js +19 -5
- 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/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 +13 -9
|
@@ -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 {
|
|
@@ -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":"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 {
|
|
@@ -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
|
/**
|
|
@@ -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.0",
|
|
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",
|
|
@@ -181,6 +181,10 @@
|
|
|
181
181
|
"./admin-issues-plugin/client": {
|
|
182
182
|
"types": "./dist/admin-issues/index.client.d.ts",
|
|
183
183
|
"import": "./dist/admin-issues/index.client.js"
|
|
184
|
+
},
|
|
185
|
+
"./settings": {
|
|
186
|
+
"types": "./dist/settings/index.d.ts",
|
|
187
|
+
"import": "./dist/settings/index.js"
|
|
184
188
|
}
|
|
185
189
|
},
|
|
186
190
|
"files": [
|
|
@@ -276,15 +280,15 @@
|
|
|
276
280
|
"multer": "^2.0.2"
|
|
277
281
|
},
|
|
278
282
|
"peerDependencies": {
|
|
279
|
-
"hazo_config": "^2.
|
|
283
|
+
"hazo_config": "^2.7.2",
|
|
280
284
|
"hazo_connect": "^4.3.5",
|
|
281
285
|
"hazo_core": "^2.5.0",
|
|
282
|
-
"hazo_i18n": "^0.
|
|
286
|
+
"hazo_i18n": "^0.17.0",
|
|
283
287
|
"hazo_logs": "^2.3.1",
|
|
284
|
-
"hazo_notify": "^7.
|
|
288
|
+
"hazo_notify": "^7.1.0",
|
|
285
289
|
"hazo_secure": "^1.9.1",
|
|
286
290
|
"hazo_theme": "^1.4.2",
|
|
287
|
-
"hazo_ui": "^6.
|
|
291
|
+
"hazo_ui": "^6.21.0",
|
|
288
292
|
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
289
293
|
"next-auth": "^4.24.0",
|
|
290
294
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -362,14 +366,14 @@
|
|
|
362
366
|
"eslint": "^9.39.1",
|
|
363
367
|
"eslint-config-next": "^16.0.4",
|
|
364
368
|
"eslint-plugin-storybook": "^10.0.6",
|
|
365
|
-
"hazo_api": "^2.
|
|
366
|
-
"hazo_config": "^2.
|
|
369
|
+
"hazo_api": "^2.10.0",
|
|
370
|
+
"hazo_config": "^2.7.2",
|
|
367
371
|
"hazo_connect": "^4.3.5",
|
|
368
372
|
"hazo_core": "^2.5.0",
|
|
369
373
|
"hazo_logs": "^2.3.1",
|
|
370
|
-
"hazo_notify": "^7.
|
|
374
|
+
"hazo_notify": "^7.1.0",
|
|
371
375
|
"hazo_theme": "^1.4.2",
|
|
372
|
-
"hazo_ui": "^6.
|
|
376
|
+
"hazo_ui": "^6.21.0",
|
|
373
377
|
"input-otp": "^1.4.0",
|
|
374
378
|
"jest": "^30.2.0",
|
|
375
379
|
"jest-environment-jsdom": "^30.0.0",
|