hazo_auth 10.9.0 → 10.14.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.
Files changed (60) hide show
  1. package/README.md +52 -0
  2. package/cli-src/cli/generate.ts +1 -0
  3. package/cli-src/lib/auth/hazo_get_tenant_auth.server.ts +12 -3
  4. package/cli-src/lib/auth/index.ts +2 -0
  5. package/cli-src/lib/cookies_config.server.ts +50 -0
  6. package/cli-src/lib/my_settings_config.server.ts +5 -1
  7. package/cli-src/lib/otp_config.server.ts +11 -0
  8. package/cli-src/lib/services/account_deletion_service.ts +67 -0
  9. package/cli-src/lib/services/index.ts +1 -0
  10. package/config/hazo_auth_config.example.ini +33 -19
  11. package/dist/cli/generate.d.ts.map +1 -1
  12. package/dist/cli/generate.js +1 -0
  13. package/dist/components/layouts/my_settings/components/danger_zone_section.d.ts +34 -0
  14. package/dist/components/layouts/my_settings/components/danger_zone_section.d.ts.map +1 -0
  15. package/dist/components/layouts/my_settings/components/danger_zone_section.js +93 -0
  16. package/dist/components/layouts/my_settings/index.d.ts +6 -1
  17. package/dist/components/layouts/my_settings/index.d.ts.map +1 -1
  18. package/dist/components/layouts/my_settings/index.js +3 -2
  19. package/dist/components/ui/button.d.ts +1 -1
  20. package/dist/hooks.d.ts +5 -0
  21. package/dist/hooks.d.ts.map +1 -0
  22. package/dist/hooks.js +29 -0
  23. package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts +10 -0
  24. package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts.map +1 -1
  25. package/dist/lib/auth/hazo_get_tenant_auth.server.js +11 -3
  26. package/dist/lib/auth/index.d.ts +1 -1
  27. package/dist/lib/auth/index.d.ts.map +1 -1
  28. package/dist/lib/auth/index.js +1 -1
  29. package/dist/lib/cookies_config.server.d.ts +20 -0
  30. package/dist/lib/cookies_config.server.d.ts.map +1 -1
  31. package/dist/lib/cookies_config.server.js +43 -0
  32. package/dist/lib/my_settings_config.server.d.ts +2 -0
  33. package/dist/lib/my_settings_config.server.d.ts.map +1 -1
  34. package/dist/lib/my_settings_config.server.js +3 -1
  35. package/dist/lib/otp_config.server.d.ts +6 -0
  36. package/dist/lib/otp_config.server.d.ts.map +1 -1
  37. package/dist/lib/otp_config.server.js +7 -0
  38. package/dist/lib/services/account_deletion_service.d.ts +22 -0
  39. package/dist/lib/services/account_deletion_service.d.ts.map +1 -0
  40. package/dist/lib/services/account_deletion_service.js +55 -0
  41. package/dist/lib/services/index.d.ts +1 -0
  42. package/dist/lib/services/index.d.ts.map +1 -1
  43. package/dist/lib/services/index.js +1 -0
  44. package/dist/page_components/my_settings.d.ts +6 -1
  45. package/dist/page_components/my_settings.d.ts.map +1 -1
  46. package/dist/page_components/my_settings.js +2 -2
  47. package/dist/server/routes/delete_account.d.ts +17 -0
  48. package/dist/server/routes/delete_account.d.ts.map +1 -0
  49. package/dist/server/routes/delete_account.js +107 -0
  50. package/dist/server/routes/index.d.ts +1 -0
  51. package/dist/server/routes/index.d.ts.map +1 -1
  52. package/dist/server/routes/index.js +1 -0
  53. package/dist/server/routes/logout.d.ts.map +1 -1
  54. package/dist/server/routes/logout.js +4 -40
  55. package/dist/server_pages/my_settings.d.ts.map +1 -1
  56. package/dist/server_pages/my_settings.js +1 -1
  57. package/dist/server_pages/otp.d.ts +12 -1
  58. package/dist/server_pages/otp.d.ts.map +1 -1
  59. package/dist/server_pages/otp.js +12 -2
  60. package/package.json +35 -89
@@ -0,0 +1,5 @@
1
+ export { use_auth_status, trigger_auth_status_refresh } from "./components/layouts/shared/hooks/use_auth_status.js";
2
+ export { use_hazo_auth, trigger_hazo_auth_refresh } from "./components/layouts/shared/hooks/use_hazo_auth.js";
3
+ export type { UseHazoAuthOptions, UseHazoAuthResult } from "./components/layouts/shared/hooks/use_hazo_auth";
4
+ export * from "./lib/auth/auth_types.js";
5
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC3G,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAI7G,cAAc,uBAAuB,CAAC"}
package/dist/hooks.js ADDED
@@ -0,0 +1,29 @@
1
+ // file_description: hooks-only client entry point — auth state without any component code
2
+ //
3
+ // USAGE:
4
+ // import { use_hazo_auth } from "hazo_auth/hooks";
5
+ //
6
+ // WHY THIS EXISTS (separate from "hazo_auth/client"):
7
+ // `hazo_auth/client` re-exports the package's entire component surface via
8
+ // `export * from "./components/index.js"` — which transitively pulls in
9
+ // ProfilePicMenu -> RolesMatrix (the whole user-management surface), the
10
+ // shadcn-derived UI kit, hazo_ui, and peer packages like sonner and the
11
+ // @radix-ui/* set. Bundlers cannot tree-shake most of that away, because these
12
+ // are "use client" modules with side effects.
13
+ //
14
+ // That is fine for a page that renders an auth layout. It is very expensive for
15
+ // a consuming app that only wants to know "is someone signed in?" in, say, a
16
+ // site header or a save button that renders on every page — a consumer doing
17
+ // exactly that measured its landing-page JS grow by more than an order of
18
+ // magnitude purely from reaching for `use_hazo_auth`.
19
+ //
20
+ // This entry point exposes the auth-state hooks and nothing else, so
21
+ // "read the session" costs a fetch wrapper rather than the whole UI kit.
22
+ // Components still come from "hazo_auth/client" (or a narrower subpath), and
23
+ // are best loaded lazily when they are actually needed.
24
+ // section: auth_state_hook_exports
25
+ export { use_auth_status, trigger_auth_status_refresh } from "./components/layouts/shared/hooks/use_auth_status.js";
26
+ export { use_hazo_auth, trigger_hazo_auth_refresh } from "./components/layouts/shared/hooks/use_hazo_auth.js";
27
+ // section: type_exports
28
+ // Type definitions are erased at runtime, so they cost nothing to re-export.
29
+ export * from "./lib/auth/auth_types.js";
@@ -1,6 +1,16 @@
1
1
  import "server-only";
2
2
  import { NextRequest } from "next/server";
3
3
  import type { TenantAuthOptions, TenantAuthResult, RequiredTenantAuthResult } from "./auth_types";
4
+ /**
5
+ * Base cookie name for scope ID (will have prefix applied).
6
+ *
7
+ * Exported so a consuming app can SET the same cookie this module READS —
8
+ * without it, an app implementing a scope switcher has to duplicate the
9
+ * configured prefix and drift the moment it changes.
10
+ */
11
+ export declare const SCOPE_COOKIE_BASE_NAME = "hazo_auth_scope_id";
12
+ /** The live, prefixed scope cookie name for this deployment. */
13
+ export declare function get_scope_cookie_name(): string;
4
14
  /**
5
15
  * Extracts scope ID from request headers or cookies
6
16
  * Priority: Header > Cookie
@@ -1 +1 @@
1
- {"version":3,"file":"hazo_get_tenant_auth.server.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/hazo_get_tenant_auth.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ1C,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EAGzB,MAAM,cAAc,CAAC;AAqBtB;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,iBAAiB,GACzB,MAAM,GAAG,SAAS,CAYpB;AA8BD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CAwF3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,wBAAwB,CAAC,CA0BnC"}
1
+ {"version":3,"file":"hazo_get_tenant_auth.server.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/hazo_get_tenant_auth.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ1C,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EAGzB,MAAM,cAAc,CAAC;AActB;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D,gEAAgE;AAChE,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAID;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,iBAAiB,GACzB,MAAM,GAAG,SAAS,CAYpB;AA8BD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CAwF3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,wBAAwB,CAAC,CA0BnC"}
@@ -15,9 +15,17 @@ import { AuthenticationRequiredError, TenantRequiredError, TenantAccessDeniedErr
15
15
  */
16
16
  const DEFAULT_SCOPE_HEADER = "X-Hazo-Scope-Id";
17
17
  /**
18
- * Base cookie name for scope ID (will have prefix applied)
18
+ * Base cookie name for scope ID (will have prefix applied).
19
+ *
20
+ * Exported so a consuming app can SET the same cookie this module READS —
21
+ * without it, an app implementing a scope switcher has to duplicate the
22
+ * configured prefix and drift the moment it changes.
19
23
  */
20
- const BASE_SCOPE_COOKIE = "hazo_auth_scope_id";
24
+ export const SCOPE_COOKIE_BASE_NAME = "hazo_auth_scope_id";
25
+ /** The live, prefixed scope cookie name for this deployment. */
26
+ export function get_scope_cookie_name() {
27
+ return get_cookie_name(SCOPE_COOKIE_BASE_NAME);
28
+ }
21
29
  // section: helpers
22
30
  /**
23
31
  * Extracts scope ID from request headers or cookies
@@ -35,7 +43,7 @@ export function extract_scope_id_from_request(request, options) {
35
43
  return header_value;
36
44
  }
37
45
  // Check cookie (with prefix)
38
- const cookie_name = options.scope_cookie_name || get_cookie_name(BASE_SCOPE_COOKIE);
46
+ const cookie_name = options.scope_cookie_name || get_cookie_name(SCOPE_COOKIE_BASE_NAME);
39
47
  const cookie_value = (_a = request.cookies.get(cookie_name)) === null || _a === void 0 ? void 0 : _a.value;
40
48
  return cookie_value;
41
49
  }
@@ -3,7 +3,7 @@ export { hazo_get_auth, get_client_ip } from "./hazo_get_auth.server.js";
3
3
  export { get_authenticated_user, require_auth, is_authenticated, } from "./auth_utils.server.js";
4
4
  export type { AuthResult, AuthUser } from "./auth_utils.server";
5
5
  export { ensure_anon_id } from "./ensure_anon_id.server.js";
6
- export { hazo_get_tenant_auth, require_tenant_auth, extract_scope_id_from_request, } from "./hazo_get_tenant_auth.server.js";
6
+ export { hazo_get_tenant_auth, require_tenant_auth, extract_scope_id_from_request, SCOPE_COOKIE_BASE_NAME, get_scope_cookie_name, } from "./hazo_get_tenant_auth.server.js";
7
7
  export type { ScopeDetails, TenantOrganization, TenantAuthOptions, TenantAuthResult, RequiredTenantAuthResult, } from "./auth_types";
8
8
  export { HazoAuthError, AuthenticationRequiredError, TenantRequiredError, TenantAccessDeniedError, } from "./auth_types.js";
9
9
  export { get_server_auth_user } from "./server_auth.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGhE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAy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;AAGzD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,uBAAuB,EACvB,8BAA8B,EAC9B,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG3E,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,wCAAwC,CAAC;AAChD,YAAY,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC"}
@@ -7,7 +7,7 @@ export { get_authenticated_user, require_auth, is_authenticated, } from "./auth_
7
7
  // section: anon_id_exports (v5.2)
8
8
  export { ensure_anon_id } from "./ensure_anon_id.server.js";
9
9
  // section: tenant_auth_exports
10
- export { hazo_get_tenant_auth, require_tenant_auth, extract_scope_id_from_request, } from "./hazo_get_tenant_auth.server.js";
10
+ export { hazo_get_tenant_auth, require_tenant_auth, extract_scope_id_from_request, SCOPE_COOKIE_BASE_NAME, get_scope_cookie_name, } from "./hazo_get_tenant_auth.server.js";
11
11
  export { HazoAuthError, AuthenticationRequiredError, TenantRequiredError, TenantAccessDeniedError, } from "./auth_types.js";
12
12
  // section: client_exports
13
13
  export { get_server_auth_user } from "./server_auth.js";
@@ -1,4 +1,5 @@
1
1
  import "server-only";
2
+ import type { NextResponse } from "next/server";
2
3
  export type CookiesConfig = {
3
4
  /** Prefix for all hazo_auth cookies (e.g., "myapp_" results in "myapp_hazo_auth_session") */
4
5
  cookie_prefix: string;
@@ -43,4 +44,23 @@ export declare function get_cached_cookies_config(): CookiesConfig;
43
44
  * Clears the cached config (useful for testing)
44
45
  */
45
46
  export declare function clear_cookies_config_cache(): void;
47
+ /**
48
+ * Clears the three core hazo_auth session cookies (USER_EMAIL, USER_ID, SESSION)
49
+ * from a response, honoring the configured cookie prefix/domain. This is the same
50
+ * clearing logic used by the logout route; reuse it anywhere a session needs to be
51
+ * torn down (e.g. self-service account deletion) instead of re-implementing it.
52
+ * @param response - NextResponse object to clear cookies from
53
+ * @returns The same response, with cleared cookies (for chaining)
54
+ */
55
+ export declare function clear_session_cookies<T extends NextResponse>(response: T): T;
56
+ /**
57
+ * Clears the NextAuth.js cookies used by the Google OAuth flow (session token,
58
+ * CSRF token, callback URL — plus their `__Secure-`/`__Host-` production variants)
59
+ * from a response. This is the same clearing logic used by the logout route; reuse
60
+ * it anywhere a NextAuth-backed session needs to be torn down (e.g. self-service
61
+ * account deletion) instead of re-implementing it.
62
+ * @param response - NextResponse object to clear cookies from
63
+ * @returns The same response, with cleared cookies (for chaining)
64
+ */
65
+ export declare function clear_nextauth_cookies<T extends NextResponse>(response: T): T;
46
66
  //# sourceMappingURL=cookies_config.server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cookies_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/cookies_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAMrB,MAAM,MAAM,aAAa,GAAG;IAC1B,6FAA6F;IAC7F,aAAa,EAAE,MAAM,CAAC;IACtB,6EAA6E;IA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D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAW5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAiB7E"}
@@ -86,3 +86,46 @@ export function get_cached_cookies_config() {
86
86
  export function clear_cookies_config_cache() {
87
87
  cached_config = null;
88
88
  }
89
+ /**
90
+ * Clears the three core hazo_auth session cookies (USER_EMAIL, USER_ID, SESSION)
91
+ * from a response, honoring the configured cookie prefix/domain. This is the same
92
+ * clearing logic used by the logout route; reuse it anywhere a session needs to be
93
+ * torn down (e.g. self-service account deletion) instead of re-implementing it.
94
+ * @param response - NextResponse object to clear cookies from
95
+ * @returns The same response, with cleared cookies (for chaining)
96
+ */
97
+ export function clear_session_cookies(response) {
98
+ const clear_cookie_options = get_cookie_options({
99
+ expires: new Date(0),
100
+ path: "/",
101
+ });
102
+ response.cookies.set(get_cookie_name(BASE_COOKIE_NAMES.USER_EMAIL), "", clear_cookie_options);
103
+ response.cookies.set(get_cookie_name(BASE_COOKIE_NAMES.USER_ID), "", clear_cookie_options);
104
+ response.cookies.set(get_cookie_name(BASE_COOKIE_NAMES.SESSION), "", clear_cookie_options);
105
+ return response;
106
+ }
107
+ /**
108
+ * Clears the NextAuth.js cookies used by the Google OAuth flow (session token,
109
+ * CSRF token, callback URL — plus their `__Secure-`/`__Host-` production variants)
110
+ * from a response. This is the same clearing logic used by the logout route; reuse
111
+ * it anywhere a NextAuth-backed session needs to be torn down (e.g. self-service
112
+ * account deletion) instead of re-implementing it.
113
+ * @param response - NextResponse object to clear cookies from
114
+ * @returns The same response, with cleared cookies (for chaining)
115
+ */
116
+ export function clear_nextauth_cookies(response) {
117
+ const clear_cookie_options = {
118
+ expires: new Date(0),
119
+ path: "/",
120
+ };
121
+ response.cookies.set("next-auth.session-token", "", clear_cookie_options);
122
+ response.cookies.set("next-auth.csrf-token", "", clear_cookie_options);
123
+ response.cookies.set("next-auth.callback-url", "", clear_cookie_options);
124
+ // Also clear secure cookie variants (used in production with HTTPS)
125
+ response.cookies.set("__Secure-next-auth.session-token", "", clear_cookie_options);
126
+ response.cookies.set("__Secure-next-auth.csrf-token", "", clear_cookie_options);
127
+ response.cookies.set("__Secure-next-auth.callback-url", "", clear_cookie_options);
128
+ // Host-prefixed variants (for some NextAuth configurations)
129
+ response.cookies.set("__Host-next-auth.csrf-token", "", clear_cookie_options);
130
+ return response;
131
+ }
@@ -36,6 +36,8 @@ export type MySettingsConfig = {
36
36
  unauthorizedMessage?: string;
37
37
  loginButtonLabel?: string;
38
38
  loginPath?: string;
39
+ /** Opt-in self-service account deletion (Danger Zone). Default: false. */
40
+ enableAccountDeletion: boolean;
39
41
  messages: {
40
42
  photo_upload_disabled_message: string;
41
43
  gravatar_setup_message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"my_settings_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/my_settings_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAYrB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE;QACV,eAAe,EAAE,OAAO,CAAC;QACzB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,oBAAoB,EAAE;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,OAAO,CAAC;QAC3B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,cAAc,EAAE;QACd,kBAAkB,EAAE,OAAO,CAAC;QAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,kBAAk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CAAC;QACnC,wBAAwB,EAAE,MAAM,EAAE,CAAC;KACpC,CAAC;CACH,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,CAyDzD"}
1
+ {"version":3,"file":"my_settings_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/my_settings_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAYrB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE;QACV,eAAe,EAAE,OAAO,CAAC;QACzB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,oBAAoB,EAAE;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,OAAO,CAAC;QAC3B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,cAAc,EAAE;QACd,kBAAkB,EAAE,OAAO,CAAC;QAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,4BAA4B,EAAE,UAAU,GAAG,SAAS,CAAC;QACrD,4BAA4B,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;QACtD,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE;QACR,6BAA6B,EAAE,MAAM,CAAC;QACtC,sBAAsB,EAAE,MAAM,CAAC;QAC/B,2BAA2B,EAAE,MAAM,CAAC;QACpC,uBAAuB,EAAE,MAAM,CAAC;KACjC,CAAC;IACF,OAAO,EAAE;QACP,aAAa,EAAE,MAAM,CAAC;QACtB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,yBAAyB,EAAE,MAAM,CAAC;QAClC,uBAAuB,EAAE,MAAM,CAAC;QAChC,0BAA0B,EAAE,MAAM,CAAC;QACnC,0BAA0B,EAAE,MAAM,CAAC;QACnC,+BAA+B,EAAE,MAAM,CAAC;QACxC,4BAA4B,EAAE,MAAM,CAAC;KACtC,CAAC;IACF,SAAS,EAAE;QACT,wBAAwB,EAAE,MAAM,EAAE,CAAC;QACnC,wBAAwB,EAAE,MAAM,EAAE,CAAC;KACpC,CAAC;CACH,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,CA2DzD"}
@@ -2,7 +2,7 @@
2
2
  // section: server-only-guard
3
3
  import "server-only";
4
4
  // section: imports
5
- import { get_config_value } from "./config/config_loader.server.js";
5
+ import { get_config_value, get_config_boolean } from "./config/config_loader.server.js";
6
6
  import { get_user_fields_config } from "./user_fields_config.server.js";
7
7
  import { get_password_requirements_config } from "./password_requirements_config.server.js";
8
8
  import { get_profile_picture_config } from "./profile_picture_config.server.js";
@@ -43,6 +43,7 @@ export function get_my_settings_config() {
43
43
  const unauthorizedMessage = get_config_value(section, "unauthorized_message", "You must be logged in to access this page.");
44
44
  const loginButtonLabel = get_config_value(section, "login_button_label", "Go to login");
45
45
  const loginPath = get_config_value(section, "login_path", "/hazo_auth/login");
46
+ const enableAccountDeletion = get_config_boolean(section, "enable_account_deletion", false);
46
47
  return {
47
48
  userFields,
48
49
  passwordRequirements,
@@ -62,6 +63,7 @@ export function get_my_settings_config() {
62
63
  unauthorizedMessage,
63
64
  loginButtonLabel,
64
65
  loginPath,
66
+ enableAccountDeletion,
65
67
  messages,
66
68
  uiSizes,
67
69
  fileTypes,
@@ -11,6 +11,8 @@ export declare const OTP_CONFIG_DEFAULTS: {
11
11
  readonly max_verify_attempts: 5;
12
12
  readonly auto_assign_scope_id: "00000000-0000-0000-0000-000000000001";
13
13
  readonly auto_assign_role_name: "member";
14
+ readonly image_src: "/hazo_auth/images/login_default.jpg";
15
+ readonly image_alt: "Sign in with a one-time code";
14
16
  };
15
17
  export type OtpConfig = {
16
18
  /** Whether to automatically register a new user when an unrecognised email requests an OTP */
@@ -35,6 +37,10 @@ export type OtpConfig = {
35
37
  auto_assign_scope_id: string;
36
38
  /** Role name to assign within the auto-assign scope */
37
39
  auto_assign_role_name: string;
40
+ /** Image shown in the OTP page's visual panel */
41
+ image_src: string;
42
+ /** Alt text for the OTP page's visual panel image */
43
+ image_alt: string;
38
44
  };
39
45
  /**
40
46
  * Reads OTP configuration from hazo_auth_config.ini [hazo_auth__otp] section.
@@ -1 +1 @@
1
- {"version":3,"file":"otp_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/otp_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAMrB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;CAYtB,CAAC;AAGX,MAAM,MAAM,SAAS,GAAG;IACtB,8FAA8F;IAC9F,aAAa,EAAE,OAAO,CAAC;IACvB,uDAAuD;IACvD,gBAAgB,EAAE,MAAM,CAAC;IACzB,qFAAqF;IACrF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oFAAoF;I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D,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF;;;GAGG;AACH,wBAAgB,cAAc,IAAI,SAAS,CA+B1C;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,CAE1D"}
@@ -16,6 +16,11 @@ export const OTP_CONFIG_DEFAULTS = {
16
16
  max_verify_attempts: 5,
17
17
  auto_assign_scope_id: "00000000-0000-0000-0000-000000000001",
18
18
  auto_assign_role_name: "member",
19
+ // Matches OTPLayout's own default. Apps that never ran `npx hazo_auth init`
20
+ // (so have no public/hazo_auth/images/) should point this at the packaged
21
+ // asset route instead: /api/hazo_auth/assets/login_default.jpg
22
+ image_src: "/hazo_auth/images/login_default.jpg",
23
+ image_alt: "Sign in with a one-time code",
19
24
  };
20
25
  // section: helpers
21
26
  /**
@@ -37,6 +42,8 @@ export function get_otp_config() {
37
42
  max_verify_attempts: get_config_number(section, "otp_max_verify_attempts", d.max_verify_attempts),
38
43
  auto_assign_scope_id: get_config_value(section, "otp_auto_assign_scope_id", d.auto_assign_scope_id),
39
44
  auto_assign_role_name: get_config_value(section, "otp_auto_assign_role_name", d.auto_assign_role_name),
45
+ image_src: get_config_value(section, "otp_image_src", d.image_src),
46
+ image_alt: get_config_value(section, "otp_image_alt", d.image_alt),
40
47
  };
41
48
  }
42
49
  /**
@@ -0,0 +1,22 @@
1
+ export type AccountDeletionResult = {
2
+ success: boolean;
3
+ error?: string;
4
+ };
5
+ /**
6
+ * Hard-deletes the caller's own `hazo_users` row.
7
+ *
8
+ * Child rows cascade automatically via `ON DELETE CASCADE` foreign keys
9
+ * (hazo_refresh_tokens, hazo_user_scopes, hazo_user_relationships,
10
+ * hazo_email_otps, hazo_legal_acceptances, hazo_google_oauth_tokens,
11
+ * hazo_user_roles) — no manual cleanup needed. A few "created by" /
12
+ * "managed by" references (hazo_users.managed_by_user_id,
13
+ * hazo_invitations.invited_by, hazo_legal_doc_versions.published_by_user_id)
14
+ * intentionally use `ON DELETE SET NULL` instead of CASCADE, by design —
15
+ * they preserve audit/history/relationship rows rather than deleting them,
16
+ * so they likewise require no manual cleanup here.
17
+ *
18
+ * @param user_id - The authenticated caller's own user ID (never another user's)
19
+ * @returns AccountDeletionResult with success status or error
20
+ */
21
+ export declare function delete_own_account(user_id: string): Promise<AccountDeletionResult>;
22
+ //# sourceMappingURL=account_deletion_service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account_deletion_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/account_deletion_service.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC,CAiChC"}
@@ -0,0 +1,55 @@
1
+ // file_description: service for self-service (hard) deletion of the caller's own hazo_users row
2
+ // section: imports
3
+ import { createCrudService } from "hazo_connect/server";
4
+ import { get_hazo_connect_instance } from "../hazo_connect_instance.server.js";
5
+ import { create_app_logger } from "../app_logger.js";
6
+ import { sanitize_error_for_user } from "../utils/error_sanitizer.js";
7
+ import { get_line_number } from "../utils/api_route_helpers.js";
8
+ // section: main_function
9
+ /**
10
+ * Hard-deletes the caller's own `hazo_users` row.
11
+ *
12
+ * Child rows cascade automatically via `ON DELETE CASCADE` foreign keys
13
+ * (hazo_refresh_tokens, hazo_user_scopes, hazo_user_relationships,
14
+ * hazo_email_otps, hazo_legal_acceptances, hazo_google_oauth_tokens,
15
+ * hazo_user_roles) — no manual cleanup needed. A few "created by" /
16
+ * "managed by" references (hazo_users.managed_by_user_id,
17
+ * hazo_invitations.invited_by, hazo_legal_doc_versions.published_by_user_id)
18
+ * intentionally use `ON DELETE SET NULL` instead of CASCADE, by design —
19
+ * they preserve audit/history/relationship rows rather than deleting them,
20
+ * so they likewise require no manual cleanup here.
21
+ *
22
+ * @param user_id - The authenticated caller's own user ID (never another user's)
23
+ * @returns AccountDeletionResult with success status or error
24
+ */
25
+ export async function delete_own_account(user_id) {
26
+ try {
27
+ const adapter = get_hazo_connect_instance();
28
+ const users_service = createCrudService(adapter, "hazo_users");
29
+ // Verify the user still exists before deleting
30
+ const users = await users_service.findBy({ id: user_id });
31
+ if (!Array.isArray(users) || users.length === 0) {
32
+ return { success: false, error: "User not found" };
33
+ }
34
+ await users_service.deleteById(user_id);
35
+ return { success: true };
36
+ }
37
+ catch (error) {
38
+ const logger = create_app_logger();
39
+ const user_friendly_error = sanitize_error_for_user(error, {
40
+ logToConsole: true,
41
+ logToLogger: true,
42
+ logger,
43
+ context: {
44
+ filename: "account_deletion_service.ts",
45
+ line_number: get_line_number(),
46
+ user_id,
47
+ operation: "delete_own_account",
48
+ },
49
+ });
50
+ return {
51
+ success: false,
52
+ error: user_friendly_error,
53
+ };
54
+ }
55
+ }
@@ -20,4 +20,5 @@ export * from "./oauth_service.js";
20
20
  export * from "./branding_service.js";
21
21
  export * from "./google_token_service.js";
22
22
  export * from "./demo_account_service.js";
23
+ export * from "./account_deletion_service.js";
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/services/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/services/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC"}
@@ -22,3 +22,4 @@ export * from "./oauth_service.js";
22
22
  export * from "./branding_service.js";
23
23
  export * from "./google_token_service.js";
24
24
  export * from "./demo_account_service.js";
25
+ export * from "./account_deletion_service.js";
@@ -46,6 +46,11 @@ export type MySettingsPageProps = {
46
46
  unauthorizedMessage?: string;
47
47
  loginButtonLabel?: string;
48
48
  loginPath?: string;
49
+ /**
50
+ * Whether the Danger Zone (account deletion) section is shown.
51
+ * Mirrors the `enable_account_deletion` config flag; defaults to off (opt-in).
52
+ */
53
+ enableAccountDeletion?: boolean;
49
54
  messages?: Partial<typeof DEFAULT_MESSAGES>;
50
55
  uiSizes?: Partial<typeof DEFAULT_UI_SIZES>;
51
56
  fileTypes?: {
@@ -59,6 +64,6 @@ export type MySettingsPageProps = {
59
64
  * @param props - Optional configuration overrides
60
65
  * @returns My settings page component
61
66
  */
62
- export declare function MySettingsPage({ userFields, passwordRequirements, profilePicture, heading, subHeading, profilePhotoLabel, profilePhotoRecommendation, uploadPhotoButtonLabel, removePhotoButtonLabel, profileInformationLabel, passwordLabel, currentPasswordLabel, newPasswordLabel, confirmPasswordLabel, savePasswordButtonLabel, unauthorizedMessage, loginButtonLabel, loginPath, messages, uiSizes, fileTypes, }?: MySettingsPageProps): import("react").JSX.Element;
67
+ export declare function MySettingsPage({ userFields, passwordRequirements, profilePicture, heading, subHeading, profilePhotoLabel, profilePhotoRecommendation, uploadPhotoButtonLabel, removePhotoButtonLabel, profileInformationLabel, passwordLabel, currentPasswordLabel, newPasswordLabel, confirmPasswordLabel, savePasswordButtonLabel, unauthorizedMessage, loginButtonLabel, loginPath, enableAccountDeletion, messages, uiSizes, fileTypes, }?: MySettingsPageProps): import("react").JSX.Element;
63
68
  export default MySettingsPage;
64
69
  //# sourceMappingURL=my_settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"my_settings.d.ts","sourceRoot":"","sources":["../../src/page_components/my_settings.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AA2B3G,QAAA,MAAM,gBAAgB;;;;;CAKrB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;;;;;;CASrB,CAAC;AAQF,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,CAAC,EAAE;QACX,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,oBA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AAC"}
@@ -53,7 +53,7 @@ const DEFAULT_FILE_TYPES = {
53
53
  * @param props - Optional configuration overrides
54
54
  * @returns My settings page component
55
55
  */
56
- export function MySettingsPage({ userFields, passwordRequirements, profilePicture, heading = "Account Settings", subHeading = "Manage your profile, password, and email preferences.", profilePhotoLabel = "Profile Photo", profilePhotoRecommendation = "Recommended: Square image, at least 200x200 pixels", uploadPhotoButtonLabel = "Upload Photo", removePhotoButtonLabel = "Remove", profileInformationLabel = "Profile Information", passwordLabel = "Password", currentPasswordLabel = "Current Password", newPasswordLabel = "New Password", confirmPasswordLabel = "Confirm Password", savePasswordButtonLabel = "Update Password", unauthorizedMessage = "You must be logged in to access this page.", loginButtonLabel = "Go to login", loginPath = "/hazo_auth/login", messages, uiSizes, fileTypes, } = {}) {
56
+ export function MySettingsPage({ userFields, passwordRequirements, profilePicture, heading = "Account Settings", subHeading = "Manage your profile, password, and email preferences.", profilePhotoLabel = "Profile Photo", profilePhotoRecommendation = "Recommended: Square image, at least 200x200 pixels", uploadPhotoButtonLabel = "Upload Photo", removePhotoButtonLabel = "Remove", profileInformationLabel = "Profile Information", passwordLabel = "Password", currentPasswordLabel = "Current Password", newPasswordLabel = "New Password", confirmPasswordLabel = "Confirm Password", savePasswordButtonLabel = "Update Password", unauthorizedMessage = "You must be logged in to access this page.", loginButtonLabel = "Go to login", loginPath = "/hazo_auth/login", enableAccountDeletion = false, messages, uiSizes, fileTypes, } = {}) {
57
57
  // Merge provided props with defaults
58
58
  const mergedUserFields = Object.assign(Object.assign({}, DEFAULT_USER_FIELDS), userFields);
59
59
  const mergedPasswordRequirements = Object.assign(Object.assign({}, DEFAULT_PASSWORD_REQUIREMENTS), passwordRequirements);
@@ -62,6 +62,6 @@ export function MySettingsPage({ userFields, passwordRequirements, profilePictur
62
62
  const mergedUiSizes = Object.assign(Object.assign({}, DEFAULT_UI_SIZES), uiSizes);
63
63
  const mergedFileTypes = Object.assign(Object.assign({}, DEFAULT_FILE_TYPES), fileTypes);
64
64
  const MySettingsLayout = my_settings_layout;
65
- return (_jsx(MySettingsLayout, { userFields: mergedUserFields, password_requirements: mergedPasswordRequirements, profilePicture: mergedProfilePicture, heading: heading, subHeading: subHeading, profilePhotoLabel: profilePhotoLabel, profilePhotoRecommendation: profilePhotoRecommendation, uploadPhotoButtonLabel: uploadPhotoButtonLabel, removePhotoButtonLabel: removePhotoButtonLabel, profileInformationLabel: profileInformationLabel, passwordLabel: passwordLabel, currentPasswordLabel: currentPasswordLabel, newPasswordLabel: newPasswordLabel, confirmPasswordLabel: confirmPasswordLabel, unauthorizedMessage: unauthorizedMessage, loginButtonLabel: loginButtonLabel, loginPath: loginPath, messages: mergedMessages, uiSizes: mergedUiSizes, fileTypes: mergedFileTypes }));
65
+ return (_jsx(MySettingsLayout, { userFields: mergedUserFields, password_requirements: mergedPasswordRequirements, profilePicture: mergedProfilePicture, heading: heading, subHeading: subHeading, profilePhotoLabel: profilePhotoLabel, profilePhotoRecommendation: profilePhotoRecommendation, uploadPhotoButtonLabel: uploadPhotoButtonLabel, removePhotoButtonLabel: removePhotoButtonLabel, profileInformationLabel: profileInformationLabel, passwordLabel: passwordLabel, currentPasswordLabel: currentPasswordLabel, newPasswordLabel: newPasswordLabel, confirmPasswordLabel: confirmPasswordLabel, unauthorizedMessage: unauthorizedMessage, loginButtonLabel: loginButtonLabel, loginPath: loginPath, enableAccountDeletion: enableAccountDeletion, messages: mergedMessages, uiSizes: mergedUiSizes, fileTypes: mergedFileTypes }));
66
66
  }
67
67
  export default MySettingsPage;
@@ -0,0 +1,17 @@
1
+ import { NextRequest, NextResponse } from "next/server";
2
+ export declare const dynamic = "force-dynamic";
3
+ /**
4
+ * DELETE - Self-service hard-delete of the caller's own account.
5
+ * Body: { confirm_email: string } — must match the authenticated user's email
6
+ * address (case-insensitive) to confirm intent.
7
+ *
8
+ * Gated by `enable_account_deletion` (default: false) in the
9
+ * `[hazo_auth__my_settings_layout]` config section — opt-in, off by default.
10
+ */
11
+ export declare function DELETE(request: NextRequest): Promise<NextResponse<{
12
+ error: string;
13
+ }> | NextResponse<{
14
+ success: boolean;
15
+ message: string;
16
+ }>>;
17
+ //# sourceMappingURL=delete_account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete_account.d.ts","sourceRoot":"","sources":["../../../src/server/routes/delete_account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAcxD,eAAO,MAAM,OAAO,kBAAkB,CAAC;AAGvC;;;;;;;GAOG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,WAAW;;;;;IAsHhD"}
@@ -0,0 +1,107 @@
1
+ // file_description: API route handler for self-service (hard) account deletion
2
+ // section: imports
3
+ import { NextResponse } from "next/server";
4
+ import { hazo_get_auth } from "../../lib/auth/hazo_get_auth.server.js";
5
+ import { delete_own_account } from "../../lib/services/account_deletion_service.js";
6
+ import { create_app_logger } from "../../lib/app_logger.js";
7
+ import { get_filename, get_line_number } from "../../lib/utils/api_route_helpers.js";
8
+ import { get_auth_cache } from "../../lib/auth/auth_cache.js";
9
+ import { get_auth_utility_config } from "../../lib/auth_utility_config.server.js";
10
+ import { get_config_boolean } from "../../lib/config/config_loader.server.js";
11
+ import { clear_session_cookies, clear_nextauth_cookies } from "../../lib/cookies_config.server.js";
12
+ // section: constants
13
+ const MY_SETTINGS_SECTION = "hazo_auth__my_settings_layout";
14
+ // section: route_config
15
+ export const dynamic = "force-dynamic";
16
+ // section: api_handler
17
+ /**
18
+ * DELETE - Self-service hard-delete of the caller's own account.
19
+ * Body: { confirm_email: string } — must match the authenticated user's email
20
+ * address (case-insensitive) to confirm intent.
21
+ *
22
+ * Gated by `enable_account_deletion` (default: false) in the
23
+ * `[hazo_auth__my_settings_layout]` config section — opt-in, off by default.
24
+ */
25
+ export async function DELETE(request) {
26
+ const logger = create_app_logger();
27
+ try {
28
+ // Resolve the caller
29
+ const auth = await hazo_get_auth(request);
30
+ if (!auth.user) {
31
+ return NextResponse.json({ error: "Authentication required" }, { status: 401 });
32
+ }
33
+ const user_id = auth.user.id;
34
+ // Feature is opt-in — refuse before doing any further work if disabled
35
+ const enabled = get_config_boolean(MY_SETTINGS_SECTION, "enable_account_deletion", false);
36
+ if (!enabled) {
37
+ logger.warn("account_deletion_disabled", {
38
+ filename: get_filename(),
39
+ line_number: get_line_number(),
40
+ user_id,
41
+ });
42
+ return NextResponse.json({ error: "Account deletion is not enabled" }, { status: 403 });
43
+ }
44
+ // Require the caller to re-type their own email address as confirmation
45
+ let body;
46
+ try {
47
+ body = await request.json();
48
+ }
49
+ catch (_a) {
50
+ body = {};
51
+ }
52
+ const confirm_email = typeof body.confirm_email === "string" ? body.confirm_email.trim() : "";
53
+ if (!confirm_email || confirm_email.toLowerCase() !== auth.user.email_address.toLowerCase()) {
54
+ logger.warn("account_deletion_confirmation_mismatch", {
55
+ filename: get_filename(),
56
+ line_number: get_line_number(),
57
+ user_id,
58
+ });
59
+ return NextResponse.json({ error: "Confirmation email does not match your account email" }, { status: 400 });
60
+ }
61
+ // Hard-delete the account (cascades to all related rows)
62
+ const result = await delete_own_account(user_id);
63
+ if (!result.success) {
64
+ logger.warn("account_deletion_failed", {
65
+ filename: get_filename(),
66
+ line_number: get_line_number(),
67
+ user_id,
68
+ error: result.error,
69
+ });
70
+ return NextResponse.json({ error: result.error || "Failed to delete account" }, { status: 400 });
71
+ }
72
+ // Invalidate auth cache now that the user is gone
73
+ try {
74
+ const auth_config = get_auth_utility_config();
75
+ const auth_cache = get_auth_cache(auth_config.cache_max_users, auth_config.cache_ttl_minutes, auth_config.cache_max_age_minutes);
76
+ auth_cache.invalidate_user(user_id);
77
+ }
78
+ catch (_b) {
79
+ // Non-fatal
80
+ }
81
+ logger.info("account_deletion_successful", {
82
+ filename: get_filename(),
83
+ line_number: get_line_number(),
84
+ user_id,
85
+ });
86
+ const response = NextResponse.json({
87
+ success: true,
88
+ message: "Account deleted successfully",
89
+ }, { status: 200 });
90
+ // Clear the three core hazo_auth session cookies — the account (and its session) no longer exists
91
+ clear_session_cookies(response);
92
+ // Also clear NextAuth cookies — a Google-OAuth user must not be left holding a live session-token
93
+ clear_nextauth_cookies(response);
94
+ return response;
95
+ }
96
+ catch (error) {
97
+ const error_message = error instanceof Error ? error.message : "Unknown error";
98
+ const error_stack = error instanceof Error ? error.stack : undefined;
99
+ logger.error("account_deletion_error", {
100
+ filename: get_filename(),
101
+ line_number: get_line_number(),
102
+ error_message,
103
+ error_stack,
104
+ });
105
+ return NextResponse.json({ error: "Failed to delete account. Please try again." }, { status: 500 });
106
+ }
107
+ }
@@ -11,6 +11,7 @@ export { POST as resendVerificationPOST } from "./resend_verification.js";
11
11
  export { PATCH as updateUserPATCH } from "./update_user.js";
12
12
  export { POST as uploadProfilePicturePOST } from "./upload_profile_picture.js";
13
13
  export { DELETE as removeProfilePictureDELETE } from "./remove_profile_picture.js";
14
+ export { DELETE as deleteAccountDELETE } from "./delete_account.js";
14
15
  export { GET as libraryPhotosGET } from "./library_photos.js";
15
16
  export { GET as libraryPhotoGET } from "./library_photo.js";
16
17
  export { GET as profilePictureFilenameGET } from "./profile_picture_filename.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/routes/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,IAAI,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,m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