authhero 9.30.0 → 9.31.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 (53) hide show
  1. package/dist/assets/u/widget/index.esm.js +1 -1
  2. package/dist/authhero.cjs +72 -72
  3. package/dist/authhero.d.ts +515 -468
  4. package/dist/authhero.mjs +11032 -10730
  5. package/dist/mfa-attempts-DXiY4U74.js +275 -0
  6. package/dist/{mfa-attempts-CQiD6hxP.mjs → mfa-attempts-Dl3I8pop.mjs} +1695 -1684
  7. package/dist/{passkey-enrollment-D_WVyvv2.js → passkey-enrollment-2Toeaevy.js} +1 -1
  8. package/dist/tsconfig.types.tsbuildinfo +1 -1
  9. package/dist/types/authentication-flows/passwordless.d.ts +5 -5
  10. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  11. package/dist/types/hooks/lifecycle-codehooks.d.ts +22 -0
  12. package/dist/types/hooks/pre-account-action.d.ts +65 -0
  13. package/dist/types/index.d.ts +459 -459
  14. package/dist/types/routes/auth-api/account.d.ts +2 -2
  15. package/dist/types/routes/auth-api/index.d.ts +18 -18
  16. package/dist/types/routes/auth-api/passwordless.d.ts +16 -16
  17. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  18. package/dist/types/routes/management-api/action-triggers.d.ts +27 -27
  19. package/dist/types/routes/management-api/actions.d.ts +14 -14
  20. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  21. package/dist/types/routes/management-api/branding.d.ts +5 -5
  22. package/dist/types/routes/management-api/clients.d.ts +4 -4
  23. package/dist/types/routes/management-api/connections.d.ts +14 -14
  24. package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
  25. package/dist/types/routes/management-api/email-templates.d.ts +18 -18
  26. package/dist/types/routes/management-api/emails.d.ts +6 -6
  27. package/dist/types/routes/management-api/failed-events.d.ts +2 -2
  28. package/dist/types/routes/management-api/flows.d.ts +8 -8
  29. package/dist/types/routes/management-api/guardian.d.ts +5 -5
  30. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  31. package/dist/types/routes/management-api/hooks.d.ts +56 -56
  32. package/dist/types/routes/management-api/index.d.ts +229 -229
  33. package/dist/types/routes/management-api/jobs.d.ts +2 -2
  34. package/dist/types/routes/management-api/keys.d.ts +12 -12
  35. package/dist/types/routes/management-api/logs.d.ts +4 -4
  36. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  37. package/dist/types/routes/management-api/organizations.d.ts +2 -2
  38. package/dist/types/routes/management-api/prompts.d.ts +6 -6
  39. package/dist/types/routes/management-api/resource-servers.d.ts +8 -8
  40. package/dist/types/routes/management-api/roles.d.ts +1 -1
  41. package/dist/types/routes/management-api/rollouts.d.ts +6 -6
  42. package/dist/types/routes/management-api/tenant-members.d.ts +8 -8
  43. package/dist/types/routes/management-api/tenant-operations.d.ts +4 -4
  44. package/dist/types/routes/management-api/tenants.d.ts +11 -11
  45. package/dist/types/routes/management-api/users.d.ts +15 -15
  46. package/dist/types/routes/universal-login/common.d.ts +10 -10
  47. package/dist/types/routes/universal-login/screens/account-helpers.d.ts +27 -1
  48. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  49. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  50. package/dist/types/state-machines/login-session.d.ts +1 -1
  51. package/dist/types/types/Hooks.d.ts +47 -0
  52. package/package.json +6 -6
  53. package/dist/mfa-attempts-DwATCXqC.js +0 -254
@@ -128,7 +128,7 @@ export declare const tenantRoutes: OpenAPIHono<{
128
128
  pushed_authorization_requests_supported?: boolean | undefined;
129
129
  authorization_response_iss_parameter_supported?: boolean | undefined;
130
130
  deployment_type?: "shared" | "wfp" | undefined;
131
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
131
+ provisioning_state?: "failed" | "pending" | "ready" | undefined;
132
132
  provisioning_error?: string | undefined;
133
133
  provisioning_state_changed_at?: string | undefined;
134
134
  bundle_configuration?: string | undefined;
@@ -216,13 +216,18 @@ export declare const tenantRoutes: OpenAPIHono<{
216
216
  };
217
217
  } & {
218
218
  json: {
219
- friendly_name?: string | undefined;
219
+ allowed_logout_urls?: string[] | undefined;
220
+ oidc_logout?: {
221
+ rp_logout_end_session_endpoint_discovery?: boolean | undefined;
222
+ } | undefined;
223
+ default_organization?: string | undefined;
224
+ audience?: string | undefined;
220
225
  id?: string | undefined;
221
226
  parent_tenant_id?: string | null | undefined;
222
227
  config_sync?: "inherit-on-read" | "synced" | "detached" | null | undefined;
223
228
  config_sync_hash?: string | null | undefined;
224
229
  config_synced_at?: string | null | undefined;
225
- audience?: string | undefined;
230
+ friendly_name?: string | undefined;
226
231
  picture_url?: string | undefined;
227
232
  support_email?: string | undefined;
228
233
  support_url?: string | undefined;
@@ -235,7 +240,6 @@ export declare const tenantRoutes: OpenAPIHono<{
235
240
  session_cookie?: {
236
241
  mode?: "persistent" | "non-persistent" | undefined;
237
242
  } | undefined;
238
- allowed_logout_urls?: string[] | undefined;
239
243
  default_redirection_uri?: string | undefined;
240
244
  default_client_id?: string | undefined;
241
245
  enabled_locales?: string[] | undefined;
@@ -309,13 +313,9 @@ export declare const tenantRoutes: OpenAPIHono<{
309
313
  } | undefined;
310
314
  } | null | undefined;
311
315
  default_audience?: string | undefined;
312
- default_organization?: string | undefined;
313
316
  sessions?: {
314
317
  oidc_logout_prompt_enabled?: boolean | undefined;
315
318
  } | undefined;
316
- oidc_logout?: {
317
- rp_logout_end_session_endpoint_discovery?: boolean | undefined;
318
- } | undefined;
319
319
  allow_organization_name_in_authentication_api?: boolean | undefined;
320
320
  customize_mfa_in_postlogin_action?: boolean | undefined;
321
321
  acr_values_supported?: string[] | undefined;
@@ -325,7 +325,7 @@ export declare const tenantRoutes: OpenAPIHono<{
325
325
  pushed_authorization_requests_supported?: boolean | undefined;
326
326
  authorization_response_iss_parameter_supported?: boolean | undefined;
327
327
  deployment_type?: "shared" | "wfp" | undefined;
328
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
328
+ provisioning_state?: "failed" | "pending" | "ready" | undefined;
329
329
  provisioning_error?: string | undefined;
330
330
  provisioning_state_changed_at?: string | undefined;
331
331
  bundle_configuration?: string | undefined;
@@ -514,7 +514,7 @@ export declare const tenantRoutes: OpenAPIHono<{
514
514
  pushed_authorization_requests_supported?: boolean | undefined;
515
515
  authorization_response_iss_parameter_supported?: boolean | undefined;
516
516
  deployment_type?: "shared" | "wfp" | undefined;
517
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
517
+ provisioning_state?: "failed" | "pending" | "ready" | undefined;
518
518
  provisioning_error?: string | undefined;
519
519
  provisioning_state_changed_at?: string | undefined;
520
520
  bundle_configuration?: string | undefined;
@@ -721,7 +721,7 @@ export declare const tenantRoutes: OpenAPIHono<{
721
721
  pushed_authorization_requests_supported?: boolean | undefined;
722
722
  authorization_response_iss_parameter_supported?: boolean | undefined;
723
723
  deployment_type?: "shared" | "wfp" | undefined;
724
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
724
+ provisioning_state?: "failed" | "pending" | "ready" | undefined;
725
725
  provisioning_error?: string | undefined;
726
726
  provisioning_state_changed_at?: string | undefined;
727
727
  bundle_configuration?: string | undefined;
@@ -875,12 +875,11 @@ export declare const userRoutes: OpenAPIHono<{
875
875
  };
876
876
  };
877
877
  output: {
878
- user_id: string;
879
- id: string;
880
878
  created_at: string;
881
879
  client_id: string;
882
880
  rotating: boolean;
883
- login_id: string;
881
+ user_id: string;
882
+ id: string;
884
883
  device: {
885
884
  initial_user_agent: string;
886
885
  initial_ip: string;
@@ -889,10 +888,12 @@ export declare const userRoutes: OpenAPIHono<{
889
888
  last_ip: string;
890
889
  last_asn: string;
891
890
  };
891
+ login_id: string;
892
892
  resource_servers: {
893
893
  audience: string;
894
894
  scopes: string;
895
895
  }[];
896
+ organization?: string | undefined;
896
897
  expires_at?: string | undefined;
897
898
  session_id?: string | undefined;
898
899
  auth_connection?: string | undefined;
@@ -900,7 +901,6 @@ export declare const userRoutes: OpenAPIHono<{
900
901
  strategy: string;
901
902
  strategy_type: string;
902
903
  } | undefined;
903
- organization?: string | undefined;
904
904
  revoked_at?: string | undefined;
905
905
  idle_expires_at?: string | undefined;
906
906
  last_exchanged_at?: string | undefined;
@@ -909,12 +909,11 @@ export declare const userRoutes: OpenAPIHono<{
909
909
  limit: number;
910
910
  length: number;
911
911
  tokens: {
912
- user_id: string;
913
- id: string;
914
912
  created_at: string;
915
913
  client_id: string;
916
914
  rotating: boolean;
917
- login_id: string;
915
+ user_id: string;
916
+ id: string;
918
917
  device: {
919
918
  initial_user_agent: string;
920
919
  initial_ip: string;
@@ -923,10 +922,12 @@ export declare const userRoutes: OpenAPIHono<{
923
922
  last_ip: string;
924
923
  last_asn: string;
925
924
  };
925
+ login_id: string;
926
926
  resource_servers: {
927
927
  audience: string;
928
928
  scopes: string;
929
929
  }[];
930
+ organization?: string | undefined;
930
931
  expires_at?: string | undefined;
931
932
  session_id?: string | undefined;
932
933
  auth_connection?: string | undefined;
@@ -934,7 +935,6 @@ export declare const userRoutes: OpenAPIHono<{
934
935
  strategy: string;
935
936
  strategy_type: string;
936
937
  } | undefined;
937
- organization?: string | undefined;
938
938
  revoked_at?: string | undefined;
939
939
  idle_expires_at?: string | undefined;
940
940
  last_exchanged_at?: string | undefined;
@@ -943,12 +943,11 @@ export declare const userRoutes: OpenAPIHono<{
943
943
  next?: string | undefined;
944
944
  } | {
945
945
  tokens: {
946
- user_id: string;
947
- id: string;
948
946
  created_at: string;
949
947
  client_id: string;
950
948
  rotating: boolean;
951
- login_id: string;
949
+ user_id: string;
950
+ id: string;
952
951
  device: {
953
952
  initial_user_agent: string;
954
953
  initial_ip: string;
@@ -957,10 +956,12 @@ export declare const userRoutes: OpenAPIHono<{
957
956
  last_ip: string;
958
957
  last_asn: string;
959
958
  };
959
+ login_id: string;
960
960
  resource_servers: {
961
961
  audience: string;
962
962
  scopes: string;
963
963
  }[];
964
+ organization?: string | undefined;
964
965
  expires_at?: string | undefined;
965
966
  session_id?: string | undefined;
966
967
  auth_connection?: string | undefined;
@@ -968,7 +969,6 @@ export declare const userRoutes: OpenAPIHono<{
968
969
  strategy: string;
969
970
  strategy_type: string;
970
971
  } | undefined;
971
- organization?: string | undefined;
972
972
  revoked_at?: string | undefined;
973
973
  idle_expires_at?: string | undefined;
974
974
  last_exchanged_at?: string | undefined;
@@ -1021,7 +1021,7 @@ export declare const userRoutes: OpenAPIHono<{
1021
1021
  };
1022
1022
  };
1023
1023
  output: {
1024
- type: "gd_send_sms" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "cfgdiff" | "cfgdrift" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "festft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "fn" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "sestft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum";
1024
+ type: "fn" | "sapi" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "cfgdiff" | "cfgdrift" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "festft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "sestft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum";
1025
1025
  date: string;
1026
1026
  isMobile: boolean;
1027
1027
  log_id: string;
@@ -1057,7 +1057,7 @@ export declare const userRoutes: OpenAPIHono<{
1057
1057
  } | undefined;
1058
1058
  }[] | {
1059
1059
  logs: {
1060
- type: "gd_send_sms" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "cfgdiff" | "cfgdrift" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "festft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "fn" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "sestft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum";
1060
+ type: "fn" | "sapi" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "cfgdiff" | "cfgdrift" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "festft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "sestft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum";
1061
1061
  date: string;
1062
1062
  isMobile: boolean;
1063
1063
  log_id: string;
@@ -1098,7 +1098,7 @@ export declare const userRoutes: OpenAPIHono<{
1098
1098
  limit: number;
1099
1099
  length: number;
1100
1100
  logs: {
1101
- type: "gd_send_sms" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "cfgdiff" | "cfgdrift" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "festft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "fn" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "sestft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum";
1101
+ type: "fn" | "sapi" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "cfgdiff" | "cfgdrift" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "festft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "sestft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum";
1102
1102
  date: string;
1103
1103
  isMobile: boolean;
1104
1104
  log_id: string;
@@ -100,7 +100,7 @@ export declare function initJSXRoute(ctx: Context<{
100
100
  url: string;
101
101
  } | undefined;
102
102
  dark_mode?: "dark" | "light" | "auto" | undefined;
103
- scope?: "shared" | "local" | "platform" | undefined;
103
+ scope?: "local" | "shared" | "platform" | undefined;
104
104
  override?: "none" | "secrets" | "fields" | undefined;
105
105
  enforce?: boolean | undefined;
106
106
  } | null;
@@ -231,7 +231,7 @@ export declare function initJSXRoute(ctx: Context<{
231
231
  pushed_authorization_requests_supported?: boolean | undefined;
232
232
  authorization_response_iss_parameter_supported?: boolean | undefined;
233
233
  deployment_type?: "shared" | "wfp" | undefined;
234
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
234
+ provisioning_state?: "failed" | "pending" | "ready" | undefined;
235
235
  provisioning_error?: string | undefined;
236
236
  provisioning_state_changed_at?: string | undefined;
237
237
  bundle_configuration?: string | undefined;
@@ -379,7 +379,7 @@ export declare function initJSXRoute(ctx: Context<{
379
379
  } | undefined;
380
380
  unique?: boolean | undefined;
381
381
  profile_required?: boolean | undefined;
382
- verification_method?: "link" | "code" | undefined;
382
+ verification_method?: "code" | "link" | undefined;
383
383
  } | undefined;
384
384
  username?: {
385
385
  identifier?: {
@@ -429,7 +429,7 @@ export declare function initJSXRoute(ctx: Context<{
429
429
  } | undefined;
430
430
  set_user_root_attributes?: "on_each_login" | "on_first_login" | "never_on_login" | undefined;
431
431
  };
432
- scope?: "shared" | "local" | "platform" | undefined;
432
+ scope?: "local" | "shared" | "platform" | undefined;
433
433
  override?: "none" | "secrets" | "fields" | undefined;
434
434
  enforce?: boolean | undefined;
435
435
  id?: string | undefined;
@@ -614,7 +614,7 @@ export declare function initJSXRoute(ctx: Context<{
614
614
  pushed_authorization_requests_supported?: boolean | undefined;
615
615
  authorization_response_iss_parameter_supported?: boolean | undefined;
616
616
  deployment_type?: "shared" | "wfp" | undefined;
617
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
617
+ provisioning_state?: "failed" | "pending" | "ready" | undefined;
618
618
  provisioning_error?: string | undefined;
619
619
  provisioning_state_changed_at?: string | undefined;
620
620
  bundle_configuration?: string | undefined;
@@ -852,7 +852,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
852
852
  url: string;
853
853
  } | undefined;
854
854
  dark_mode?: "dark" | "light" | "auto" | undefined;
855
- scope?: "shared" | "local" | "platform" | undefined;
855
+ scope?: "local" | "shared" | "platform" | undefined;
856
856
  override?: "none" | "secrets" | "fields" | undefined;
857
857
  enforce?: boolean | undefined;
858
858
  } | null;
@@ -983,7 +983,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
983
983
  pushed_authorization_requests_supported?: boolean | undefined;
984
984
  authorization_response_iss_parameter_supported?: boolean | undefined;
985
985
  deployment_type?: "shared" | "wfp" | undefined;
986
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
986
+ provisioning_state?: "failed" | "pending" | "ready" | undefined;
987
987
  provisioning_error?: string | undefined;
988
988
  provisioning_state_changed_at?: string | undefined;
989
989
  bundle_configuration?: string | undefined;
@@ -1131,7 +1131,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
1131
1131
  } | undefined;
1132
1132
  unique?: boolean | undefined;
1133
1133
  profile_required?: boolean | undefined;
1134
- verification_method?: "link" | "code" | undefined;
1134
+ verification_method?: "code" | "link" | undefined;
1135
1135
  } | undefined;
1136
1136
  username?: {
1137
1137
  identifier?: {
@@ -1181,7 +1181,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
1181
1181
  } | undefined;
1182
1182
  set_user_root_attributes?: "on_each_login" | "on_first_login" | "never_on_login" | undefined;
1183
1183
  };
1184
- scope?: "shared" | "local" | "platform" | undefined;
1184
+ scope?: "local" | "shared" | "platform" | undefined;
1185
1185
  override?: "none" | "secrets" | "fields" | undefined;
1186
1186
  enforce?: boolean | undefined;
1187
1187
  id?: string | undefined;
@@ -1435,7 +1435,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
1435
1435
  pushed_authorization_requests_supported?: boolean | undefined;
1436
1436
  authorization_response_iss_parameter_supported?: boolean | undefined;
1437
1437
  deployment_type?: "shared" | "wfp" | undefined;
1438
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
1438
+ provisioning_state?: "failed" | "pending" | "ready" | undefined;
1439
1439
  provisioning_error?: string | undefined;
1440
1440
  provisioning_state_changed_at?: string | undefined;
1441
1441
  bundle_configuration?: string | undefined;
@@ -2,7 +2,8 @@
2
2
  * Shared helpers for account management screens
3
3
  */
4
4
  import type { User, Session } from "@authhero/adapter-interfaces";
5
- import type { ScreenContext } from "./types";
5
+ import type { ScreenContext, ScreenFactory, ScreenHandler } from "./types";
6
+ import type { AccountActionOperation } from "../../../types/Hooks";
6
7
  /**
7
8
  * Resolve the authenticated user from the session cookie.
8
9
  * Used by all account screens that need the current user.
@@ -11,3 +12,28 @@ export declare function resolveAccountUser(context: ScreenContext): Promise<{
11
12
  user: User;
12
13
  session: Session;
13
14
  }>;
15
+ /**
16
+ * Run the `pre-account-action` trigger for an operation the user is starting.
17
+ * Returns the URL to send the user to when an Action redirects, `undefined`
18
+ * to continue, and throws `AccountActionDeniedError` when an Action denies.
19
+ */
20
+ export declare function gateAccountOperation(context: ScreenContext, operation: AccountActionOperation, options?: {
21
+ user?: User | (() => Promise<User | undefined>);
22
+ details?: Record<string, string>;
23
+ }): Promise<string | undefined>;
24
+ /**
25
+ * Wrap a screen's GET factory so the trigger fires when the user opens the
26
+ * screen. POST handlers that re-render the screen call the unwrapped factory.
27
+ */
28
+ export declare function gatedScreen(operation: AccountActionOperation, factory: ScreenFactory, options?: {
29
+ details?: Record<string, string>;
30
+ user?: (context: ScreenContext) => Promise<User | undefined>;
31
+ }): ScreenFactory;
32
+ /**
33
+ * Wrap a screen's POST handler so the trigger also runs where the change
34
+ * happens. Gating only the GET would let a direct POST skip a denial.
35
+ */
36
+ export declare function gatedPost(operation: AccountActionOperation, post: NonNullable<ScreenHandler["post"]>, options?: {
37
+ details?: Record<string, string>;
38
+ user?: (context: ScreenContext, data: Record<string, unknown>) => Promise<User | undefined>;
39
+ }): NonNullable<ScreenHandler["post"]>;
@@ -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: "reset-password" | "impersonate" | "signup" | "account" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "account" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "account" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "account" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "account" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "account" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "login" | "enter-password" | "consent" | "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";
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: "reset-password" | "impersonate" | "signup" | "login" | "enter-password" | "consent" | "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";
244
244
  };
245
245
  } & {
246
246
  query: {
@@ -229,7 +229,7 @@ export declare const loginSessionMachine: import("xstate").StateMachine<LoginSes
229
229
  }, {
230
230
  type: "passwordResetRequested";
231
231
  params: unknown;
232
- }, never, "pending" | "failed" | "expired" | "authenticated" | "awaiting_email_verification" | "awaiting_mfa" | "awaiting_consent" | "awaiting_hook" | "awaiting_continuation" | "completed", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
232
+ }, never, "failed" | "pending" | "expired" | "authenticated" | "awaiting_email_verification" | "awaiting_mfa" | "awaiting_consent" | "awaiting_hook" | "awaiting_continuation" | "completed", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
233
233
  id: "loginSession";
234
234
  states: {
235
235
  readonly pending: {};
@@ -226,6 +226,51 @@ export type OnExecutePostUserDeletionAPI = {
226
226
  export type OnExecutePostUserDeletion = (event: HookEvent & {
227
227
  user_id: string;
228
228
  }, api: OnExecutePostUserDeletionAPI) => Promise<void>;
229
+ /**
230
+ * Self-service account operations that fire the `pre-account-action` trigger
231
+ * (an AuthHero extension; Auth0 has no equivalent). The trigger runs once when
232
+ * the user starts the operation, before any form, code or write.
233
+ */
234
+ export type AccountActionOperation = "change-email" | "update-profile" | "reset-password" | "enroll-mfa" | "remove-mfa" | "enroll-passkey" | "remove-passkey" | "unlink-identity" | "delete-account";
235
+ export type PreAccountActionEvent = {
236
+ ctx: Context<{
237
+ Bindings: Bindings;
238
+ Variables: Variables;
239
+ }>;
240
+ operation: AccountActionOperation;
241
+ /**
242
+ * The signed-in user. Undefined only for `reset-password` when the
243
+ * identifier entered so far doesn't match a user (or none was entered).
244
+ */
245
+ user?: User;
246
+ /** Connection of the user's primary identity. */
247
+ connection?: {
248
+ id?: string;
249
+ name: string;
250
+ strategy?: string;
251
+ };
252
+ client?: EnrichedClient;
253
+ tenant: {
254
+ id: string;
255
+ };
256
+ request: HookRequest;
257
+ /** Operation-specific detail, e.g. `{ factor: "totp" }` for `enroll-mfa`. */
258
+ details?: Record<string, string>;
259
+ };
260
+ export type OnExecutePreAccountActionAPI = {
261
+ redirect: {
262
+ /** Send the user to `url` instead of running the operation here. */
263
+ sendUserTo: (url: string, options?: {
264
+ query?: Record<string, string>;
265
+ }) => void;
266
+ };
267
+ access: {
268
+ /** Stop the operation and show `reason` to the user. */
269
+ deny: (reason?: string) => void;
270
+ };
271
+ token: TokenAPI;
272
+ };
273
+ export type OnExecutePreAccountAction = (event: PreAccountActionEvent, api: OnExecutePreAccountActionAPI) => Promise<void>;
229
274
  export type OnExecuteValidateRegistrationUsernameAPI = {
230
275
  deny: (reason?: string) => void;
231
276
  token: TokenAPI;
@@ -264,6 +309,8 @@ export type Hooks = {
264
309
  onExecutePreUserDeletion?: OnExecutePreUserDeletion;
265
310
  onExecutePostUserDeletion?: OnExecutePostUserDeletion;
266
311
  onExecuteValidateRegistrationUsername?: OnExecuteValidateRegistrationUsername;
312
+ /** Called when a user starts a self-service account operation (AuthHero extension) */
313
+ onExecutePreAccountAction?: OnExecutePreAccountAction;
267
314
  /** Called when /userinfo endpoint is accessed to add custom claims */
268
315
  onFetchUserInfo?: OnFetchUserInfo;
269
316
  };
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.31.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/kysely-adapter": "12.19.1",
67
+ "@authhero/widget": "0.41.11"
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.27.0",
85
+ "@authhero/proxy": "0.11.14",
86
+ "@authhero/saml": "0.6.7"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@authhero/widget": ">=0.38.9",