authhero 9.19.0 → 9.20.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 (62) hide show
  1. package/dist/authhero.cjs +185 -173
  2. package/dist/authhero.d.ts +355 -241
  3. package/dist/authhero.mjs +19286 -16839
  4. package/dist/tsconfig.types.tsbuildinfo +1 -1
  5. package/dist/types/authentication-flows/email-verification.d.ts +74 -0
  6. package/dist/types/authentication-flows/password.d.ts +3 -2
  7. package/dist/types/authentication-flows/passwordless.d.ts +2 -2
  8. package/dist/types/emails/index.d.ts +27 -1
  9. package/dist/types/generated/locale-types.d.ts +282 -0
  10. package/dist/types/helpers/dcr/metadata-mapping.d.ts +1 -1
  11. package/dist/types/helpers/default-destinations.d.ts +7 -1
  12. package/dist/types/helpers/outbox-destinations/code-hooks.d.ts +5 -1
  13. package/dist/types/helpers/request-data.d.ts +15 -0
  14. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  15. package/dist/types/helpers/run-outbox-relay.d.ts +7 -1
  16. package/dist/types/hooks/codehooks.d.ts +14 -1
  17. package/dist/types/index.d.ts +288 -238
  18. package/dist/types/routes/auth-api/index.d.ts +12 -12
  19. package/dist/types/routes/auth-api/passwordless.d.ts +10 -10
  20. package/dist/types/routes/auth-api/revoke.d.ts +6 -6
  21. package/dist/types/routes/auth-api/token.d.ts +10 -10
  22. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  23. package/dist/types/routes/management-api/action-triggers.d.ts +1 -1
  24. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  25. package/dist/types/routes/management-api/branding.d.ts +1 -1
  26. package/dist/types/routes/management-api/client-grants.d.ts +9 -9
  27. package/dist/types/routes/management-api/connections.d.ts +7 -7
  28. package/dist/types/routes/management-api/email-templates.d.ts +18 -18
  29. package/dist/types/routes/management-api/failed-events.d.ts +51 -1
  30. package/dist/types/routes/management-api/forms.d.ts +126 -126
  31. package/dist/types/routes/management-api/guardian.d.ts +5 -5
  32. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  33. package/dist/types/routes/management-api/hook-code.d.ts +2 -2
  34. package/dist/types/routes/management-api/index.d.ts +269 -219
  35. package/dist/types/routes/management-api/keys.d.ts +8 -8
  36. package/dist/types/routes/management-api/logs.d.ts +4 -4
  37. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  38. package/dist/types/routes/management-api/organizations.d.ts +6 -6
  39. package/dist/types/routes/management-api/prompts.d.ts +4 -4
  40. package/dist/types/routes/management-api/roles.d.ts +1 -1
  41. package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
  42. package/dist/types/routes/management-api/tenant-operations.d.ts +1 -1
  43. package/dist/types/routes/management-api/tenants.d.ts +6 -6
  44. package/dist/types/routes/management-api/themes.d.ts +6 -6
  45. package/dist/types/routes/management-api/users.d.ts +15 -15
  46. package/dist/types/routes/universal-login/common.d.ts +4 -4
  47. package/dist/types/routes/universal-login/error-page.d.ts +9 -2
  48. package/dist/types/routes/universal-login/flow-api.d.ts +12 -12
  49. package/dist/types/routes/universal-login/identifier.d.ts +2 -2
  50. package/dist/types/routes/universal-login/index.d.ts +2 -2
  51. package/dist/types/routes/universal-login/sanitization-utils.d.ts +7 -0
  52. package/dist/types/routes/universal-login/screen-prompt-map.d.ts +2 -0
  53. package/dist/types/routes/universal-login/screens/email-verification.d.ts +29 -0
  54. package/dist/types/routes/universal-login/screens/handler-error.d.ts +11 -0
  55. package/dist/types/routes/universal-login/screens/reset-password.d.ts +5 -1
  56. package/dist/types/routes/universal-login/screens/signup.d.ts +6 -0
  57. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  58. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  59. package/dist/types/types/AuthHeroConfig.d.ts +25 -0
  60. package/dist/types/types/Bindings.d.ts +8 -1
  61. package/dist/types/types/Variables.d.ts +18 -1
  62. package/package.json +6 -6
@@ -27,7 +27,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
27
27
  output: {
28
28
  screen: {
29
29
  action: string;
30
- method: "POST" | "GET";
30
+ method: "GET" | "POST";
31
31
  components: {
32
32
  id: string;
33
33
  type: string;
@@ -43,7 +43,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
43
43
  hint?: string | undefined;
44
44
  messages?: {
45
45
  text: string;
46
- type: "success" | "error" | "info" | "warning";
46
+ type: "error" | "success" | "info" | "warning";
47
47
  id?: number | undefined;
48
48
  }[] | undefined;
49
49
  }[];
@@ -51,7 +51,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
51
51
  description?: string | undefined;
52
52
  messages?: {
53
53
  text: string;
54
- type: "success" | "error" | "info" | "warning";
54
+ type: "error" | "success" | "info" | "warning";
55
55
  id?: number | undefined;
56
56
  }[] | undefined;
57
57
  links?: {
@@ -107,7 +107,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
107
107
  output: {
108
108
  screen: {
109
109
  action: string;
110
- method: "POST" | "GET";
110
+ method: "GET" | "POST";
111
111
  components: {
112
112
  id: string;
113
113
  type: string;
@@ -123,7 +123,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
123
123
  hint?: string | undefined;
124
124
  messages?: {
125
125
  text: string;
126
- type: "success" | "error" | "info" | "warning";
126
+ type: "error" | "success" | "info" | "warning";
127
127
  id?: number | undefined;
128
128
  }[] | undefined;
129
129
  }[];
@@ -131,7 +131,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
131
131
  description?: string | undefined;
132
132
  messages?: {
133
133
  text: string;
134
- type: "success" | "error" | "info" | "warning";
134
+ type: "error" | "success" | "info" | "warning";
135
135
  id?: number | undefined;
136
136
  }[] | undefined;
137
137
  links?: {
@@ -204,7 +204,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
204
204
  output: {
205
205
  screen: {
206
206
  action: string;
207
- method: "POST" | "GET";
207
+ method: "GET" | "POST";
208
208
  components: {
209
209
  id: string;
210
210
  type: string;
@@ -220,7 +220,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
220
220
  hint?: string | undefined;
221
221
  messages?: {
222
222
  text: string;
223
- type: "success" | "error" | "info" | "warning";
223
+ type: "error" | "success" | "info" | "warning";
224
224
  id?: number | undefined;
225
225
  }[] | undefined;
226
226
  }[];
@@ -228,7 +228,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
228
228
  description?: string | undefined;
229
229
  messages?: {
230
230
  text: string;
231
- type: "success" | "error" | "info" | "warning";
231
+ type: "error" | "success" | "info" | "warning";
232
232
  id?: number | undefined;
233
233
  }[] | undefined;
234
234
  links?: {
@@ -319,7 +319,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
319
319
  output: {
320
320
  screen: {
321
321
  action: string;
322
- method: "POST" | "GET";
322
+ method: "GET" | "POST";
323
323
  components: {
324
324
  id: string;
325
325
  type: string;
@@ -335,7 +335,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
335
335
  hint?: string | undefined;
336
336
  messages?: {
337
337
  text: string;
338
- type: "success" | "error" | "info" | "warning";
338
+ type: "error" | "success" | "info" | "warning";
339
339
  id?: number | undefined;
340
340
  }[] | undefined;
341
341
  }[];
@@ -343,7 +343,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
343
343
  description?: string | undefined;
344
344
  messages?: {
345
345
  text: string;
346
- type: "success" | "error" | "info" | "warning";
346
+ type: "error" | "success" | "info" | "warning";
347
347
  id?: number | undefined;
348
348
  }[] | undefined;
349
349
  links?: {
@@ -30,7 +30,7 @@ export declare const identifierRoutes: OpenAPIHono<{
30
30
  } & {
31
31
  form: {
32
32
  username: string;
33
- login_selection?: "password" | "code" | undefined;
33
+ login_selection?: "code" | "password" | undefined;
34
34
  };
35
35
  };
36
36
  output: {};
@@ -44,7 +44,7 @@ export declare const identifierRoutes: OpenAPIHono<{
44
44
  } & {
45
45
  form: {
46
46
  username: string;
47
- login_selection?: "password" | "code" | undefined;
47
+ login_selection?: "code" | "password" | undefined;
48
48
  };
49
49
  };
50
50
  output: {};
@@ -515,7 +515,7 @@ export default function create(config: AuthHeroConfig): OpenAPIHono<{
515
515
  } & {
516
516
  form: {
517
517
  username: string;
518
- login_selection?: "password" | "code" | undefined;
518
+ login_selection?: "code" | "password" | undefined;
519
519
  };
520
520
  };
521
521
  output: {};
@@ -529,7 +529,7 @@ export default function create(config: AuthHeroConfig): OpenAPIHono<{
529
529
  } & {
530
530
  form: {
531
531
  username: string;
532
- login_selection?: "password" | "code" | undefined;
532
+ login_selection?: "code" | "password" | undefined;
533
533
  };
534
534
  };
535
535
  output: {};
@@ -22,6 +22,13 @@ export declare function escapeCssUrl(url: string): string;
22
22
  * Sanitize URL for use in href/src attributes
23
23
  */
24
24
  export declare function sanitizeUrl(url: string | undefined): string;
25
+ /**
26
+ * Validate a URL for a JSX link `href` and return it unescaped, since JSX
27
+ * escapes attribute values itself (running sanitizeUrl first double-escapes
28
+ * `&` in query strings). Only http(s) and same-origin paths are allowed —
29
+ * no `data:` here, as the result is a clickable link.
30
+ */
31
+ export declare function safeLinkHref(url: string | undefined): string | undefined;
25
32
  /**
26
33
  * Sanitize CSS color value
27
34
  */
@@ -0,0 +1,2 @@
1
+ import type { PromptScreen } from "@authhero/adapter-interfaces";
2
+ export declare function getPromptScreenForScreen(screenId: string): PromptScreen | undefined;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Email verification screens for logins blocked on an unverified email
3
+ * (client `email_validation: "enforced"`). Which one is shown follows the
4
+ * database connection's `attributes.email.verification_method`:
5
+ *
6
+ * - "code" (default): email-verification-code — enter the emailed code and
7
+ * the same login session continues.
8
+ * - "link": email-verification-link-sent — the emailed link verifies the
9
+ * address and returns the user to the login screen.
10
+ *
11
+ * Corresponds to: /u2/login/email-verification and
12
+ * /u2/login/email-verification-sent
13
+ */
14
+ import type { ScreenContext, ScreenResult, ScreenDefinition } from "./types";
15
+ import { LoginEmailVerification } from "../../../authentication-flows/email-verification";
16
+ /**
17
+ * The verification options a u2 password login passes to `loginWithPassword`.
18
+ * The link method returns the user to this session's login screen.
19
+ */
20
+ export declare function getLoginEmailVerification(context: ScreenContext): Promise<LoginEmailVerification>;
21
+ /**
22
+ * The screen to show after a u2 password login threw EMAIL_NOT_VERIFIED. The
23
+ * verification email has already been sent by the password grant.
24
+ */
25
+ export declare function emailVerificationRequiredScreen(context: ScreenContext, email: string | undefined): Promise<ScreenResult>;
26
+ export declare function emailVerificationCodeScreen(context: ScreenContext): Promise<ScreenResult>;
27
+ export declare function emailVerificationLinkSentScreen(context: ScreenContext): Promise<ScreenResult>;
28
+ export declare const emailVerificationCodeScreenDefinition: ScreenDefinition;
29
+ export declare const emailVerificationLinkSentScreenDefinition: ScreenDefinition;
@@ -0,0 +1,11 @@
1
+ import type { UiScreen } from "@authhero/adapter-interfaces";
2
+ /**
3
+ * Surface a screen handler's `error` as a screen-level message, unless the
4
+ * re-rendered screen already shows an error (on a field or at screen level).
5
+ *
6
+ * Handlers usually attach a localized message to the offending field, so
7
+ * adding `error` on top would show the same problem twice. The fallback only
8
+ * kicks in for handlers that return an error without rendering one, so the
9
+ * user isn't left with an unchanged screen and no explanation.
10
+ */
11
+ export declare function withHandlerError(screen: UiScreen, error: string): UiScreen;
@@ -23,8 +23,12 @@ export declare function executePasswordReset(params: {
23
23
  }): Promise<{
24
24
  success: true;
25
25
  } | {
26
- error: string;
26
+ error: "user_not_found" | "code_expired" | "reset_failed";
27
27
  field: "code" | "password";
28
+ } | {
29
+ error: "password_policy";
30
+ field: "password";
31
+ policyError: unknown;
28
32
  }>;
29
33
  /**
30
34
  * Create the reset-password screen
@@ -3,7 +3,13 @@
3
3
  *
4
4
  * Corresponds to: /u/signup
5
5
  */
6
+ import type { CustomText } from "@authhero/adapter-interfaces";
6
7
  import type { ScreenContext, ScreenResult, ScreenDefinition } from "./types";
8
+ /**
9
+ * Translate a validatePasswordPolicy failure into a user-facing message.
10
+ * The PasswordPolicyError message itself is English-only.
11
+ */
12
+ export declare function localizePasswordPolicyError(error: unknown, locale: string, customText?: CustomText): string;
7
13
  /**
8
14
  * Create the signup screen
9
15
  */
@@ -165,7 +165,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
165
165
  $get: {
166
166
  input: {
167
167
  param: {
168
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "account" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
168
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
169
169
  };
170
170
  } & {
171
171
  query: {
@@ -181,7 +181,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
181
181
  } | {
182
182
  input: {
183
183
  param: {
184
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "account" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
184
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
185
185
  };
186
186
  } & {
187
187
  query: {
@@ -197,7 +197,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
197
197
  } | {
198
198
  input: {
199
199
  param: {
200
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "account" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
200
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
201
201
  };
202
202
  } & {
203
203
  query: {
@@ -217,7 +217,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
217
217
  $post: {
218
218
  input: {
219
219
  param: {
220
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
220
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "consent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
221
221
  };
222
222
  } & {
223
223
  query: {
@@ -235,7 +235,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
235
235
  } | {
236
236
  input: {
237
237
  param: {
238
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
238
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "consent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
239
239
  };
240
240
  } & {
241
241
  query: {
@@ -170,7 +170,7 @@ export declare const u2Routes: OpenAPIHono<{
170
170
  $get: {
171
171
  input: {
172
172
  param: {
173
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "account" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
173
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
174
174
  };
175
175
  } & {
176
176
  query: {
@@ -186,7 +186,7 @@ export declare const u2Routes: OpenAPIHono<{
186
186
  } | {
187
187
  input: {
188
188
  param: {
189
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "account" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
189
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
190
190
  };
191
191
  } & {
192
192
  query: {
@@ -202,7 +202,7 @@ export declare const u2Routes: OpenAPIHono<{
202
202
  } | {
203
203
  input: {
204
204
  param: {
205
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "account" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
205
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
206
206
  };
207
207
  } & {
208
208
  query: {
@@ -222,7 +222,7 @@ export declare const u2Routes: OpenAPIHono<{
222
222
  $post: {
223
223
  input: {
224
224
  param: {
225
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
225
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "consent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
226
226
  };
227
227
  } & {
228
228
  query: {
@@ -240,7 +240,7 @@ export declare const u2Routes: OpenAPIHono<{
240
240
  } | {
241
241
  input: {
242
242
  param: {
243
- screen: "impersonate" | "signup" | "consent" | "login" | "reset-password" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
243
+ screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "consent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
244
244
  };
245
245
  } & {
246
246
  query: {
@@ -204,6 +204,11 @@ export type UserLinkingModeResolver = (params: {
204
204
  client_id?: string;
205
205
  }) => UserLinkingMode | Promise<UserLinkingMode>;
206
206
  export type UserLinkingModeOption = UserLinkingMode | UserLinkingModeResolver;
207
+ /**
208
+ * Which action (code hook) console output is persisted to
209
+ * `action_executions.logs`. See `AuthHeroConfig.actionExecutionLogs`.
210
+ */
211
+ export type ActionExecutionLogCapture = "full" | "errors" | "off";
207
212
  /**
208
213
  * Resolver for the per-tenant username/password provider value.
209
214
  *
@@ -728,6 +733,26 @@ export interface AuthHeroConfig {
728
733
  * @default false
729
734
  */
730
735
  rejectUnknownHosts?: boolean;
736
+ /**
737
+ * Controls which action (code hook) console output is persisted to
738
+ * `action_executions.logs`. Actions still capture and see their own
739
+ * console output while they run; only what is written to the database
740
+ * changes. The execution record itself (status, results) is always
741
+ * persisted.
742
+ *
743
+ * - `"full"`: persist console output for every action, subject to the
744
+ * 256-character budget per execution.
745
+ * - `"errors"`: persist console output only for actions that failed
746
+ * (errored or denied access). Output from successful actions is dropped.
747
+ * - `"off"`: never persist console output.
748
+ *
749
+ * `credentials-exchange` runs on every token exchange, and console output
750
+ * often contains user PII, so `"errors"` or `"off"` is recommended for
751
+ * high-volume or privacy-sensitive deployments.
752
+ *
753
+ * @default "full"
754
+ */
755
+ actionExecutionLogs?: ActionExecutionLogCapture;
731
756
  /**
732
757
  * Relax the management API audience check from a hard 403 to a
733
758
  * `console.warn`. Tokens issued for any other audience will still be
@@ -2,7 +2,7 @@ import type { SigningCertificateAuthority } from "../helpers/signing-certificate
2
2
  import { CodeExecutor, DataAdapters } from "@authhero/adapter-interfaces";
3
3
  import type { SamlSigner } from "@authhero/saml/core";
4
4
  import { Hooks } from "./Hooks";
5
- import { EntityHooksConfig, McpConfig, OutboxConfig, SigningKeyModeOption, TenantOperationExecutorBinding, UserLinkingModeOption, UsernamePasswordProviderResolver, WebhookInvoker } from "./AuthHeroConfig";
5
+ import { ActionExecutionLogCapture, EntityHooksConfig, McpConfig, OutboxConfig, SigningKeyModeOption, TenantOperationExecutorBinding, UserLinkingModeOption, UsernamePasswordProviderResolver, WebhookInvoker } from "./AuthHeroConfig";
6
6
  import { StrategyHandler } from "../strategies";
7
7
  export type Bindings = {
8
8
  ENVIRONMENT: string;
@@ -11,6 +11,12 @@ export type Bindings = {
11
11
  UNIVERSAL_LOGIN_URL?: string;
12
12
  OAUTH_API_URL?: string;
13
13
  ENCRYPTION_KEY?: string;
14
+ /**
15
+ * @deprecated Read `ctx.var.data` instead. Holds the raw adapter passed in
16
+ * at startup until a route group composes its per-request stack, after
17
+ * which it is a compatibility alias for the same object as `ctx.var.data`.
18
+ * The alias will be removed in the next major release (#140).
19
+ */
14
20
  data: DataAdapters;
15
21
  hooks?: Hooks;
16
22
  /**
@@ -45,6 +51,7 @@ export type Bindings = {
45
51
  signingKeyMode?: SigningKeyModeOption;
46
52
  signingCertificateAuthority?: SigningCertificateAuthority;
47
53
  rejectUnknownHosts?: boolean;
54
+ actionExecutionLogs?: ActionExecutionLogCapture;
48
55
  mcp?: McpConfig;
49
56
  /**
50
57
  * Allow outbound fetches (jwks_uri, request_uri) to localhost / private IP
@@ -1,9 +1,26 @@
1
- import { LoginSession } from "@authhero/adapter-interfaces";
1
+ import { DataAdapters, LoginSession } from "@authhero/adapter-interfaces";
2
2
  import { CountryCode } from "libphonenumber-js";
3
3
  import { Auth0Client } from "./Auth0Client";
4
4
  import type { PreferState } from "../middlewares/prefer";
5
5
  import type { EmbedLoginContext } from "../routes/universal-login/embed";
6
6
  export type Variables = {
7
+ /**
8
+ * The adapter stack for this request. Read this, not `ctx.env.data`.
9
+ *
10
+ * Route groups compose a per-request stack (`composeAuthData({ ctx, ... })`)
11
+ * that holds request-scoped state: the dedup map, the client-bundle promise
12
+ * and hooks bound to this `ctx`. It lives here rather than on `env` because
13
+ * Cloudflare Workers hand every request in an isolate the same `env`
14
+ * object, so a stack stored there leaks between concurrent requests (#140).
15
+ *
16
+ * Typed as required because `applyConfigMiddleware`, the first middleware
17
+ * of every route group, always sets it (to the startup adapter until a
18
+ * route group composes its own stack). Optional would force a guard on
19
+ * every read for a case that cannot happen behind that middleware; code
20
+ * mounted without it has to set the variable itself. Set it through
21
+ * `setRequestData` so the deprecated `ctx.env.data` alias stays in sync.
22
+ */
23
+ data: DataAdapters;
7
24
  tenant_id: string;
8
25
  ip: string;
9
26
  client_id?: string;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "9.19.0",
14
+ "version": "9.20.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
@@ -63,8 +63,8 @@
63
63
  "vite": "^8.0.14",
64
64
  "vite-plugin-dts": "^4.5.4",
65
65
  "vitest": "^4.1.7",
66
- "@authhero/kysely-adapter": "12.11.1",
67
- "@authhero/widget": "0.40.1"
66
+ "@authhero/kysely-adapter": "12.12.0",
67
+ "@authhero/widget": "0.40.2"
68
68
  },
69
69
  "dependencies": {
70
70
  "@peculiar/x509": "^1.14.3",
@@ -80,9 +80,9 @@
80
80
  "qrcode": "^1.5.4",
81
81
  "sanitize-html": "^2.17.4",
82
82
  "xstate": "^5.31.1",
83
- "@authhero/adapter-interfaces": "4.17.0",
84
- "@authhero/proxy": "0.11.3",
85
- "@authhero/saml": "0.5.15"
83
+ "@authhero/adapter-interfaces": "4.18.0",
84
+ "@authhero/proxy": "0.11.4",
85
+ "@authhero/saml": "0.5.16"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@authhero/widget": "^0.1.0",