authhero 9.30.0 → 9.33.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 (67) hide show
  1. package/dist/assets/u/widget/index.esm.js +1 -1
  2. package/dist/authhero.cjs +73 -73
  3. package/dist/authhero.d.ts +498 -270
  4. package/dist/authhero.mjs +11270 -10741
  5. package/dist/mfa-attempts-DNgUKmta.js +275 -0
  6. package/dist/{mfa-attempts-CQiD6hxP.mjs → mfa-attempts-dhkGMzI5.mjs} +6287 -5852
  7. package/dist/{passkey-enrollment-D_WVyvv2.js → passkey-enrollment-B_o8pQ1z.js} +1 -1
  8. package/dist/tsconfig.types.tsbuildinfo +1 -1
  9. package/dist/types/authentication-flows/common.d.ts +12 -1
  10. package/dist/types/authentication-flows/passwordless.d.ts +16 -5
  11. package/dist/types/authentication-flows/refresh-token.d.ts +1 -0
  12. package/dist/types/helpers/cimd.d.ts +8 -0
  13. package/dist/types/helpers/client.d.ts +17 -1
  14. package/dist/types/helpers/dcr/metadata-mapping.d.ts +1 -1
  15. package/dist/types/helpers/login-session-tenant.d.ts +22 -0
  16. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  17. package/dist/types/helpers/session-transfer.d.ts +158 -0
  18. package/dist/types/hooks/lifecycle-codehooks.d.ts +22 -0
  19. package/dist/types/hooks/pre-account-action.d.ts +65 -0
  20. package/dist/types/index.d.ts +397 -267
  21. package/dist/types/routes/auth-api/authorize.d.ts +6 -0
  22. package/dist/types/routes/auth-api/index.d.ts +44 -27
  23. package/dist/types/routes/auth-api/oidc-logout.d.ts +3 -3
  24. package/dist/types/routes/auth-api/passwordless.d.ts +12 -12
  25. package/dist/types/routes/auth-api/register/index.d.ts +2 -2
  26. package/dist/types/routes/auth-api/token.d.ts +21 -10
  27. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  28. package/dist/types/routes/management-api/actions.d.ts +1 -1
  29. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  30. package/dist/types/routes/management-api/branding.d.ts +14 -14
  31. package/dist/types/routes/management-api/clients.d.ts +86 -18
  32. package/dist/types/routes/management-api/connections.d.ts +7 -7
  33. package/dist/types/routes/management-api/email-templates.d.ts +18 -18
  34. package/dist/types/routes/management-api/failed-events.d.ts +2 -2
  35. package/dist/types/routes/management-api/forms.d.ts +144 -144
  36. package/dist/types/routes/management-api/guardian.d.ts +5 -5
  37. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  38. package/dist/types/routes/management-api/hooks.d.ts +7 -7
  39. package/dist/types/routes/management-api/index.d.ts +368 -255
  40. package/dist/types/routes/management-api/keys.d.ts +8 -8
  41. package/dist/types/routes/management-api/logs.d.ts +4 -4
  42. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  43. package/dist/types/routes/management-api/organizations.d.ts +2 -2
  44. package/dist/types/routes/management-api/prompts.d.ts +6 -6
  45. package/dist/types/routes/management-api/refresh_tokens.d.ts +5 -0
  46. package/dist/types/routes/management-api/sessions.d.ts +5 -0
  47. package/dist/types/routes/management-api/tenant-operations.d.ts +9 -9
  48. package/dist/types/routes/management-api/tenants.d.ts +7 -7
  49. package/dist/types/routes/management-api/themes.d.ts +9 -9
  50. package/dist/types/routes/management-api/users.d.ts +42 -12
  51. package/dist/types/routes/saml/index.d.ts +6 -6
  52. package/dist/types/routes/saml/samlp.d.ts +6 -6
  53. package/dist/types/routes/universal-login/common.d.ts +39 -12
  54. package/dist/types/routes/universal-login/flow-api.d.ts +12 -12
  55. package/dist/types/routes/universal-login/impersonate.d.ts +2 -2
  56. package/dist/types/routes/universal-login/index.d.ts +2 -2
  57. package/dist/types/routes/universal-login/screens/account-helpers.d.ts +27 -1
  58. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  59. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  60. package/dist/types/state-machines/login-session.d.ts +2 -0
  61. package/dist/types/types/GrantFlowResult.d.ts +13 -0
  62. package/dist/types/types/Hooks.d.ts +71 -0
  63. package/dist/types/types/Variables.d.ts +12 -1
  64. package/dist/types/utils/cookies.d.ts +15 -0
  65. package/dist/types/utils/session-transfer-token.d.ts +56 -0
  66. package/package.json +6 -6
  67. package/dist/mfa-attempts-DwATCXqC.js +0 -254
@@ -165,7 +165,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
165
165
  $get: {
166
166
  input: {
167
167
  param: {
168
- screen: "signup" | "impersonate" | "account" | "consent" | "login" | "reset-password" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation" | "device/complete";
168
+ screen: "signup" | "account" | "reset-password" | "login" | "enter-password" | "impersonate" | "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" | "device/code" | "device/confirmation" | "device/complete";
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: "signup" | "impersonate" | "account" | "consent" | "login" | "reset-password" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation" | "device/complete";
184
+ screen: "signup" | "account" | "reset-password" | "login" | "enter-password" | "impersonate" | "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" | "device/code" | "device/confirmation" | "device/complete";
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: "signup" | "impersonate" | "account" | "consent" | "login" | "reset-password" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation" | "device/complete";
200
+ screen: "signup" | "account" | "reset-password" | "login" | "enter-password" | "impersonate" | "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" | "device/code" | "device/confirmation" | "device/complete";
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: "signup" | "impersonate" | "consent" | "login" | "reset-password" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation";
220
+ screen: "signup" | "reset-password" | "login" | "enter-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" | "device/code" | "device/confirmation";
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: "signup" | "impersonate" | "consent" | "login" | "reset-password" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation";
238
+ screen: "signup" | "reset-password" | "login" | "enter-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" | "device/code" | "device/confirmation";
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: "signup" | "impersonate" | "account" | "consent" | "login" | "reset-password" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation" | "device/complete";
173
+ screen: "signup" | "account" | "reset-password" | "login" | "enter-password" | "impersonate" | "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" | "device/code" | "device/confirmation" | "device/complete";
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: "signup" | "impersonate" | "account" | "consent" | "login" | "reset-password" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation" | "device/complete";
189
+ screen: "signup" | "account" | "reset-password" | "login" | "enter-password" | "impersonate" | "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" | "device/code" | "device/confirmation" | "device/complete";
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: "signup" | "impersonate" | "account" | "consent" | "login" | "reset-password" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation" | "device/complete";
205
+ screen: "signup" | "account" | "reset-password" | "login" | "enter-password" | "impersonate" | "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" | "device/code" | "device/confirmation" | "device/complete";
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: "signup" | "impersonate" | "consent" | "login" | "reset-password" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation";
225
+ screen: "signup" | "reset-password" | "login" | "enter-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" | "device/code" | "device/confirmation";
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: "signup" | "impersonate" | "consent" | "login" | "reset-password" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "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" | "device/code" | "device/confirmation";
243
+ screen: "signup" | "reset-password" | "login" | "enter-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" | "device/code" | "device/confirmation";
244
244
  };
245
245
  } & {
246
246
  query: {
@@ -1,6 +1,7 @@
1
1
  import { type PasswordResetFlow } from "./password-reset";
2
2
  import { LoginSession, LoginSessionState } from "@authhero/adapter-interfaces";
3
3
  import type { SessionCookieDiagnostics } from "../utils/cookies";
4
+ import type { SessionTransferCarrierState } from "../helpers/session-transfer";
4
5
  export interface MfaRequiredByAction {
5
6
  /** The provider the (last enabling) action passed, e.g. "any". */
6
7
  provider: string;
@@ -48,6 +49,7 @@ export interface LoginSessionData {
48
49
  };
49
50
  try_connection_result?: unknown;
50
51
  session_cookie?: SessionCookieDiagnostics;
52
+ session_transfer?: SessionTransferCarrierState;
51
53
  }
52
54
  /** The on-disk JSON shape stays flat for compatibility with existing sessions. */
53
55
  export declare function readLoginSessionData(raw?: string | null): LoginSessionData;
@@ -24,6 +24,19 @@ export interface GrantFlowResult {
24
24
  auth_time?: number;
25
25
  /** The connection name used for authentication (e.g., "email", "google-oauth2") */
26
26
  authConnection?: string;
27
+ authStrategy?: {
28
+ strategy: string;
29
+ strategy_type: string;
30
+ };
31
+ /**
32
+ * Set when the refresh-token grant was asked for a session_transfer_token
33
+ * (`audience=urn:{domain}:session_transfer`). The token endpoint returns
34
+ * `token` in place of an access token; `audience` is what the request named.
35
+ */
36
+ session_transfer?: {
37
+ token: string;
38
+ audience: string;
39
+ };
27
40
  }
28
41
  export interface GrantFlowUserResult extends GrantFlowResult {
29
42
  user: User;
@@ -111,6 +111,30 @@ export type HookEvent = {
111
111
  last_ip?: string;
112
112
  last_user_agent?: string;
113
113
  };
114
+ /**
115
+ * Present when the session was created by redeeming a
116
+ * session_transfer_token. `parent_refresh_token.id` is the rotation family
117
+ * of the refresh token the token was minted from.
118
+ */
119
+ session_transfer?: {
120
+ client_id: string;
121
+ parent_refresh_token: {
122
+ id: string;
123
+ };
124
+ };
125
+ };
126
+ /**
127
+ * Present on the login that redeemed a session_transfer_token. `client_id`
128
+ * is the client that minted it and `request` describes the minting request.
129
+ */
130
+ session_transfer_token?: {
131
+ client_id: string;
132
+ scope?: string;
133
+ request: {
134
+ ip: string;
135
+ asn?: string;
136
+ user_agent?: string;
137
+ };
114
138
  };
115
139
  security_context?: {
116
140
  ja3?: string;
@@ -226,6 +250,51 @@ export type OnExecutePostUserDeletionAPI = {
226
250
  export type OnExecutePostUserDeletion = (event: HookEvent & {
227
251
  user_id: string;
228
252
  }, api: OnExecutePostUserDeletionAPI) => Promise<void>;
253
+ /**
254
+ * Self-service account operations that fire the `pre-account-action` trigger
255
+ * (an AuthHero extension; Auth0 has no equivalent). The trigger runs once when
256
+ * the user starts the operation, before any form, code or write.
257
+ */
258
+ export type AccountActionOperation = "change-email" | "update-profile" | "reset-password" | "enroll-mfa" | "remove-mfa" | "enroll-passkey" | "remove-passkey" | "unlink-identity" | "delete-account";
259
+ export type PreAccountActionEvent = {
260
+ ctx: Context<{
261
+ Bindings: Bindings;
262
+ Variables: Variables;
263
+ }>;
264
+ operation: AccountActionOperation;
265
+ /**
266
+ * The signed-in user. Undefined only for `reset-password` when the
267
+ * identifier entered so far doesn't match a user (or none was entered).
268
+ */
269
+ user?: User;
270
+ /** Connection of the user's primary identity. */
271
+ connection?: {
272
+ id?: string;
273
+ name: string;
274
+ strategy?: string;
275
+ };
276
+ client?: EnrichedClient;
277
+ tenant: {
278
+ id: string;
279
+ };
280
+ request: HookRequest;
281
+ /** Operation-specific detail, e.g. `{ factor: "totp" }` for `enroll-mfa`. */
282
+ details?: Record<string, string>;
283
+ };
284
+ export type OnExecutePreAccountActionAPI = {
285
+ redirect: {
286
+ /** Send the user to `url` instead of running the operation here. */
287
+ sendUserTo: (url: string, options?: {
288
+ query?: Record<string, string>;
289
+ }) => void;
290
+ };
291
+ access: {
292
+ /** Stop the operation and show `reason` to the user. */
293
+ deny: (reason?: string) => void;
294
+ };
295
+ token: TokenAPI;
296
+ };
297
+ export type OnExecutePreAccountAction = (event: PreAccountActionEvent, api: OnExecutePreAccountActionAPI) => Promise<void>;
229
298
  export type OnExecuteValidateRegistrationUsernameAPI = {
230
299
  deny: (reason?: string) => void;
231
300
  token: TokenAPI;
@@ -264,6 +333,8 @@ export type Hooks = {
264
333
  onExecutePreUserDeletion?: OnExecutePreUserDeletion;
265
334
  onExecutePostUserDeletion?: OnExecutePostUserDeletion;
266
335
  onExecuteValidateRegistrationUsername?: OnExecuteValidateRegistrationUsername;
336
+ /** Called when a user starts a self-service account operation (AuthHero extension) */
337
+ onExecutePreAccountAction?: OnExecutePreAccountAction;
267
338
  /** Called when /userinfo endpoint is accessed to add custom claims */
268
339
  onFetchUserInfo?: OnFetchUserInfo;
269
340
  };
@@ -1,4 +1,4 @@
1
- import { DataAdapters, LoginSession, RequestAuth } from "@authhero/adapter-interfaces";
1
+ import { DataAdapters, LoginSession, RequestAuth, SessionTransferProvenance } 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";
@@ -80,4 +80,15 @@ export type Variables = {
80
80
  dur: number;
81
81
  }[];
82
82
  is_lazy_migration?: boolean;
83
+ client_id_from_token?: boolean;
84
+ session_transfer_token?: {
85
+ client_id: string;
86
+ scope?: string;
87
+ request: {
88
+ ip: string;
89
+ asn?: string;
90
+ user_agent?: string;
91
+ };
92
+ };
93
+ session_transfer?: SessionTransferProvenance;
83
94
  };
@@ -78,3 +78,18 @@ export declare function getPrivateBrowsingCookie(cookieHeaders?: string): boolea
78
78
  */
79
79
  export declare function getLastUsedConnectionCookie(tenant_id: string, cookieHeaders?: string): string | undefined;
80
80
  export declare function serializeLastUsedConnectionCookie(tenant_id: string, connectionName: string, hostname?: string): string;
81
+ /**
82
+ * The session_transfer_token an application placed in the
83
+ * `auth0_session_transfer_token` cookie before sending the browser to
84
+ * /authorize (Auth0 "Native to Web SSO"). AuthHero never sets this cookie; the
85
+ * application does, on a domain it shares with the tenant.
86
+ */
87
+ export declare function getSessionTransferCookie(cookieHeaders?: string): string | undefined;
88
+ /**
89
+ * Expire the session transfer cookie once it has been presented. The token is
90
+ * single-use, so leaving it in the jar only makes every later /authorize log a
91
+ * failed transfer. The application chose the cookie's scope, which the request
92
+ * does not reveal, so both the host-only and the parent-domain variant are
93
+ * cleared. Returns Set-Cookie header values.
94
+ */
95
+ export declare function clearSessionTransferCookie(hostname?: string): string[];
@@ -0,0 +1,56 @@
1
+ /**
2
+ * The wire-level pieces of a session_transfer_token (#1710, Auth0 "Native to
3
+ * Web SSO"). Everything here is pure: no request context and no data adapters,
4
+ * so the logging helper can import it without a cycle.
5
+ */
6
+ /** `issued_token_type` of the exchange response. */
7
+ export declare const SESSION_TRANSFER_TOKEN_TYPE = "urn:auth0:params:oauth:token-type:session_transfer_token";
8
+ /** Query parameter that carries the token to /authorize. */
9
+ export declare const SESSION_TRANSFER_TOKEN_PARAM = "session_transfer_token";
10
+ /** Cookie that carries the token to /authorize. */
11
+ export declare const SESSION_TRANSFER_COOKIE_NAME = "auth0_session_transfer_token";
12
+ /** A token is valid for one minute and works once. */
13
+ export declare const SESSION_TRANSFER_TOKEN_TTL_SECONDS = 60;
14
+ /** `codes.code_type` of the stored token. */
15
+ export declare const SESSION_TRANSFER_CODE_TYPE = "session_transfer_token";
16
+ /**
17
+ * Header in which an authenticated confidential client with
18
+ * `session_transfer.trust_forwarded_ip` passes the end user's IP address.
19
+ */
20
+ export declare const SESSION_TRANSFER_FORWARDED_IP_HEADER = "auth0-forwarded-for";
21
+ /**
22
+ * A refresh-token exchange asks for a session_transfer_token by naming the
23
+ * audience `urn:{tenantDomain}:session_transfer`. The domain is not compared:
24
+ * the token is tenant-scoped and a tenant can be reached on several domains.
25
+ */
26
+ export declare function isSessionTransferAudience(audience: string | undefined): audience is string;
27
+ /** A fresh opaque token: 256 bits from the CSPRNG, base64url. */
28
+ export declare function generateSessionTransferToken(): string;
29
+ /**
30
+ * Only the SHA-256 of a token is stored, as the `code_id` it is looked up by,
31
+ * so a database read does not yield usable tokens.
32
+ */
33
+ export declare function hashSessionTransferToken(token: string): Promise<string>;
34
+ /**
35
+ * Remove the session_transfer_token from a URL before it is stored or handed
36
+ * to a hook, log or log stream: the parameter itself, and a `request`
37
+ * parameter whose Request Object carries the token. The token is a bearer
38
+ * credential for a session; a URL that never contained it is returned
39
+ * untouched.
40
+ */
41
+ export declare function stripSessionTransferToken(url: string): string;
42
+ export declare function stripSessionTransferToken(url: string | undefined): string | undefined;
43
+ /**
44
+ * Replace the token in a parsed query-string record (as logged with a request)
45
+ * with a placeholder: the parameter itself, and a `request` parameter whose
46
+ * Request Object carries the token. Returns the input when neither is there.
47
+ */
48
+ export declare function redactSessionTransferQuery<T>(query: Record<string, T>): Record<string, T | string>;
49
+ /**
50
+ * Canonical text form of an IP address, or undefined when the value is not
51
+ * one. Device binding compares canonical forms so the same address spelled two
52
+ * ways (`::FFFF:192.0.2.1` and `192.0.2.1`, upper and lower case hex, zero
53
+ * compression) still matches, and so a forwarded header cannot smuggle
54
+ * anything that is not an address into the stored record.
55
+ */
56
+ export declare function normalizeIp(value: string | undefined): string | undefined;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/sesamyab/authhero"
13
13
  },
14
- "version": "9.30.0",
14
+ "version": "9.33.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.19.0",
67
- "@authhero/widget": "0.41.10"
66
+ "@authhero/widget": "0.41.12",
67
+ "@authhero/kysely-adapter": "12.20.0"
68
68
  },
69
69
  "dependencies": {
70
70
  "@peculiar/x509": "^1.14.3",
@@ -81,9 +81,9 @@
81
81
  "qrcode": "^1.5.4",
82
82
  "sanitize-html": "^2.17.4",
83
83
  "xstate": "^5.31.1",
84
- "@authhero/adapter-interfaces": "4.26.0",
85
- "@authhero/proxy": "0.11.13",
86
- "@authhero/saml": "0.6.6"
84
+ "@authhero/adapter-interfaces": "4.28.0",
85
+ "@authhero/saml": "0.6.8",
86
+ "@authhero/proxy": "0.11.15"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@authhero/widget": ">=0.38.9",