authhero 9.39.0 → 9.41.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 (82) hide show
  1. package/dist/assets/u/widget/authhero-widget.esm.js +1 -1
  2. package/dist/assets/u/widget/index.esm.js +1 -1
  3. package/dist/assets/u/widget/p-603aa8fa.entry.js +1 -0
  4. package/dist/assets/u/widget/p-6774edd2.entry.js +1 -0
  5. package/dist/authhero.cjs +173 -168
  6. package/dist/authhero.d.ts +717 -611
  7. package/dist/authhero.mjs +14301 -12851
  8. package/dist/{mfa-DMThiuUR.mjs → mfa-CdC-9ysu.mjs} +89 -89
  9. package/dist/{mfa-Dh6nNiRX.js → mfa-Dx8-AJ6U.js} +2 -2
  10. package/dist/mfa-attempts-CtWWceg2.js +393 -0
  11. package/dist/{mfa-attempts-O0x4jJzl.mjs → mfa-attempts-mBkfX0wf.mjs} +7055 -6373
  12. package/dist/{passkey-enrollment-CSeOQWv1.js → passkey-enrollment-KQcVF_QM.js} +1 -1
  13. package/dist/tsconfig.types.tsbuildinfo +1 -1
  14. package/dist/types/authentication-flows/common.d.ts +4 -1
  15. package/dist/types/authentication-flows/mfa-attempts.d.ts +7 -0
  16. package/dist/types/generated/locale-types.d.ts +45 -0
  17. package/dist/types/helpers/client.d.ts +1 -0
  18. package/dist/types/helpers/code-recipient.d.ts +37 -0
  19. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  20. package/dist/types/hooks/codehooks.d.ts +45 -0
  21. package/dist/types/hooks/helpers/action-users.d.ts +56 -0
  22. package/dist/types/hooks/helpers/post-login-account-linking.d.ts +18 -4
  23. package/dist/types/hooks/lifecycle-codehooks.d.ts +2 -2
  24. package/dist/types/hooks/pre-screen.d.ts +114 -0
  25. package/dist/types/index.d.ts +409 -363
  26. package/dist/types/routes/auth-api/index.d.ts +20 -20
  27. package/dist/types/routes/auth-api/passwordless.d.ts +14 -14
  28. package/dist/types/routes/auth-api/revoke.d.ts +6 -6
  29. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  30. package/dist/types/routes/management-api/action-triggers.d.ts +28 -28
  31. package/dist/types/routes/management-api/actions.d.ts +13 -13
  32. package/dist/types/routes/management-api/branding-uploads.d.ts +4 -4
  33. package/dist/types/routes/management-api/branding.d.ts +9 -9
  34. package/dist/types/routes/management-api/client-registration-tokens.d.ts +3 -3
  35. package/dist/types/routes/management-api/clients.d.ts +20 -18
  36. package/dist/types/routes/management-api/connections.d.ts +15 -9
  37. package/dist/types/routes/management-api/emails.d.ts +6 -6
  38. package/dist/types/routes/management-api/failed-events.d.ts +4 -4
  39. package/dist/types/routes/management-api/forms.d.ts +168 -144
  40. package/dist/types/routes/management-api/guardian.d.ts +1 -1
  41. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  42. package/dist/types/routes/management-api/hooks.d.ts +49 -49
  43. package/dist/types/routes/management-api/index.d.ts +370 -338
  44. package/dist/types/routes/management-api/jobs.d.ts +2 -2
  45. package/dist/types/routes/management-api/keys.d.ts +4 -4
  46. package/dist/types/routes/management-api/log-streams.d.ts +6 -6
  47. package/dist/types/routes/management-api/logs.d.ts +4 -4
  48. package/dist/types/routes/management-api/organizations.d.ts +2 -2
  49. package/dist/types/routes/management-api/prompts.d.ts +8 -8
  50. package/dist/types/routes/management-api/resource-servers.d.ts +8 -8
  51. package/dist/types/routes/management-api/roles.d.ts +1 -1
  52. package/dist/types/routes/management-api/rollouts.d.ts +6 -6
  53. package/dist/types/routes/management-api/self-service-profiles.d.ts +1 -1
  54. package/dist/types/routes/management-api/tenant-members.d.ts +8 -8
  55. package/dist/types/routes/management-api/tenant-operations.d.ts +4 -4
  56. package/dist/types/routes/management-api/tenants.d.ts +20 -20
  57. package/dist/types/routes/management-api/users.d.ts +12 -12
  58. package/dist/types/routes/universal-login/common.d.ts +6 -6
  59. package/dist/types/routes/universal-login/flow-api.d.ts +8 -8
  60. package/dist/types/routes/universal-login/pre-screen-gates.d.ts +31 -0
  61. package/dist/types/routes/universal-login/screens/account-change-email.d.ts +52 -0
  62. package/dist/types/routes/universal-login/screens/account-helpers.d.ts +19 -24
  63. package/dist/types/routes/universal-login/screens/account.d.ts +6 -0
  64. package/dist/types/routes/universal-login/screens/index.d.ts +4 -2
  65. package/dist/types/routes/universal-login/screens/invalid-session.d.ts +10 -0
  66. package/dist/types/routes/universal-login/screens/login-otp.d.ts +81 -7
  67. package/dist/types/routes/universal-login/screens/magic-link-sent.d.ts +8 -1
  68. package/dist/types/routes/universal-login/screens/signup.d.ts +0 -3
  69. package/dist/types/routes/universal-login/screens/social-connections.d.ts +31 -0
  70. package/dist/types/routes/universal-login/screens/types.d.ts +3 -0
  71. package/dist/types/routes/universal-login/u2-index.d.ts +19 -5
  72. package/dist/types/routes/universal-login/u2-routes.d.ts +6 -5
  73. package/dist/types/routes/universal-login/u2-widget-page.d.ts +1 -4
  74. package/dist/types/state-machines/login-session-data.d.ts +36 -1
  75. package/dist/types/state-machines/login-session.d.ts +29 -1
  76. package/dist/types/types/Hooks.d.ts +62 -17
  77. package/dist/types/types/Variables.d.ts +2 -0
  78. package/dist/types/utils/embedded-browser.d.ts +4 -0
  79. package/package.json +6 -6
  80. package/dist/assets/u/widget/p-32247347.entry.js +0 -1
  81. package/dist/assets/u/widget/p-3f908508.entry.js +0 -1
  82. package/dist/mfa-attempts-BaKbuGvZ.js +0 -321
@@ -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?: "failed" | "pending" | "ready" | undefined;
131
+ provisioning_state?: "pending" | "failed" | "ready" | undefined;
132
132
  provisioning_error?: string | undefined;
133
133
  provisioning_state_changed_at?: string | undefined;
134
134
  bundle_configuration?: string | undefined;
@@ -200,7 +200,7 @@ export declare const tenantRoutes: OpenAPIHono<{
200
200
  } | undefined;
201
201
  allow_remember_browser?: boolean | undefined;
202
202
  remember_browser_lifetime_in_days?: number | undefined;
203
- policy?: "never" | "always" | "all-applications" | "confidence-score" | undefined;
203
+ policy?: "always" | "never" | "all-applications" | "confidence-score" | undefined;
204
204
  } | undefined;
205
205
  is_control_plane?: boolean | undefined;
206
206
  has_children?: boolean | undefined;
@@ -219,11 +219,22 @@ export declare const tenantRoutes: OpenAPIHono<{
219
219
  } & {
220
220
  json: {
221
221
  id?: string | undefined;
222
+ session_cookie?: {
223
+ mode?: "persistent" | "non-persistent" | undefined;
224
+ } | undefined;
225
+ sessions?: {
226
+ oidc_logout_prompt_enabled?: boolean | undefined;
227
+ } | undefined;
228
+ allowed_logout_urls?: string[] | undefined;
229
+ oidc_logout?: {
230
+ rp_logout_end_session_endpoint_discovery?: boolean | undefined;
231
+ } | undefined;
232
+ default_organization?: string | undefined;
233
+ audience?: string | undefined;
222
234
  parent_tenant_id?: string | null | undefined;
223
235
  config_sync?: "inherit-on-read" | "synced" | "detached" | null | undefined;
224
236
  config_sync_hash?: string | null | undefined;
225
237
  config_synced_at?: string | null | undefined;
226
- audience?: string | undefined;
227
238
  friendly_name?: string | undefined;
228
239
  picture_url?: string | undefined;
229
240
  support_email?: string | undefined;
@@ -234,10 +245,6 @@ export declare const tenantRoutes: OpenAPIHono<{
234
245
  idle_session_lifetime?: number | undefined;
235
246
  ephemeral_session_lifetime?: number | undefined;
236
247
  idle_ephemeral_session_lifetime?: number | undefined;
237
- session_cookie?: {
238
- mode?: "persistent" | "non-persistent" | undefined;
239
- } | undefined;
240
- allowed_logout_urls?: string[] | undefined;
241
248
  default_redirection_uri?: string | undefined;
242
249
  default_client_id?: string | undefined;
243
250
  enabled_locales?: string[] | undefined;
@@ -311,13 +318,6 @@ export declare const tenantRoutes: OpenAPIHono<{
311
318
  } | undefined;
312
319
  } | null | undefined;
313
320
  default_audience?: string | undefined;
314
- default_organization?: string | undefined;
315
- sessions?: {
316
- oidc_logout_prompt_enabled?: boolean | undefined;
317
- } | undefined;
318
- oidc_logout?: {
319
- rp_logout_end_session_endpoint_discovery?: boolean | undefined;
320
- } | undefined;
321
321
  allow_organization_name_in_authentication_api?: boolean | undefined;
322
322
  customize_mfa_in_postlogin_action?: boolean | undefined;
323
323
  acr_values_supported?: string[] | undefined;
@@ -327,7 +327,7 @@ export declare const tenantRoutes: OpenAPIHono<{
327
327
  pushed_authorization_requests_supported?: boolean | undefined;
328
328
  authorization_response_iss_parameter_supported?: boolean | undefined;
329
329
  deployment_type?: "shared" | "wfp" | undefined;
330
- provisioning_state?: "failed" | "pending" | "ready" | undefined;
330
+ provisioning_state?: "pending" | "failed" | "ready" | undefined;
331
331
  provisioning_error?: string | undefined;
332
332
  provisioning_state_changed_at?: string | undefined;
333
333
  bundle_configuration?: string | undefined;
@@ -374,7 +374,7 @@ export declare const tenantRoutes: OpenAPIHono<{
374
374
  } | undefined;
375
375
  } | undefined;
376
376
  mfa?: {
377
- policy?: "never" | "always" | "all-applications" | "confidence-score" | undefined;
377
+ policy?: "always" | "never" | "all-applications" | "confidence-score" | undefined;
378
378
  factors?: {
379
379
  sms?: boolean | undefined;
380
380
  otp?: boolean | undefined;
@@ -518,7 +518,7 @@ export declare const tenantRoutes: OpenAPIHono<{
518
518
  pushed_authorization_requests_supported?: boolean | undefined;
519
519
  authorization_response_iss_parameter_supported?: boolean | undefined;
520
520
  deployment_type?: "shared" | "wfp" | undefined;
521
- provisioning_state?: "failed" | "pending" | "ready" | undefined;
521
+ provisioning_state?: "pending" | "failed" | "ready" | undefined;
522
522
  provisioning_error?: string | undefined;
523
523
  provisioning_state_changed_at?: string | undefined;
524
524
  bundle_configuration?: string | undefined;
@@ -590,7 +590,7 @@ export declare const tenantRoutes: OpenAPIHono<{
590
590
  } | undefined;
591
591
  allow_remember_browser?: boolean | undefined;
592
592
  remember_browser_lifetime_in_days?: number | undefined;
593
- policy?: "never" | "always" | "all-applications" | "confidence-score" | undefined;
593
+ policy?: "always" | "never" | "all-applications" | "confidence-score" | undefined;
594
594
  } | undefined;
595
595
  is_control_plane?: boolean | undefined;
596
596
  has_children?: boolean | undefined;
@@ -727,7 +727,7 @@ export declare const tenantRoutes: OpenAPIHono<{
727
727
  pushed_authorization_requests_supported?: boolean | undefined;
728
728
  authorization_response_iss_parameter_supported?: boolean | undefined;
729
729
  deployment_type?: "shared" | "wfp" | undefined;
730
- provisioning_state?: "failed" | "pending" | "ready" | undefined;
730
+ provisioning_state?: "pending" | "failed" | "ready" | undefined;
731
731
  provisioning_error?: string | undefined;
732
732
  provisioning_state_changed_at?: string | undefined;
733
733
  bundle_configuration?: string | undefined;
@@ -799,7 +799,7 @@ export declare const tenantRoutes: OpenAPIHono<{
799
799
  } | undefined;
800
800
  allow_remember_browser?: boolean | undefined;
801
801
  remember_browser_lifetime_in_days?: number | undefined;
802
- policy?: "never" | "always" | "all-applications" | "confidence-score" | undefined;
802
+ policy?: "always" | "never" | "all-applications" | "confidence-score" | undefined;
803
803
  } | undefined;
804
804
  is_control_plane?: boolean | undefined;
805
805
  has_children?: boolean | undefined;
@@ -891,11 +891,10 @@ export declare const userRoutes: OpenAPIHono<{
891
891
  };
892
892
  output: {
893
893
  id: string;
894
+ user_id: string;
894
895
  created_at: string;
895
896
  client_id: string;
896
- user_id: string;
897
897
  rotating: boolean;
898
- login_id: string;
899
898
  device: {
900
899
  initial_user_agent: string;
901
900
  initial_ip: string;
@@ -904,6 +903,7 @@ export declare const userRoutes: OpenAPIHono<{
904
903
  last_ip: string;
905
904
  last_asn: string;
906
905
  };
906
+ login_id: string;
907
907
  resource_servers: {
908
908
  audience: string;
909
909
  scopes: string;
@@ -913,6 +913,7 @@ export declare const userRoutes: OpenAPIHono<{
913
913
  family_id: string;
914
914
  cascade_revocation: boolean;
915
915
  } | undefined;
916
+ organization?: string | undefined;
916
917
  expires_at?: string | undefined;
917
918
  session_id?: string | undefined;
918
919
  auth_connection?: string | undefined;
@@ -920,7 +921,6 @@ export declare const userRoutes: OpenAPIHono<{
920
921
  strategy: string;
921
922
  strategy_type: string;
922
923
  } | undefined;
923
- organization?: string | undefined;
924
924
  revoked_at?: string | undefined;
925
925
  idle_expires_at?: string | undefined;
926
926
  last_exchanged_at?: string | undefined;
@@ -930,11 +930,10 @@ export declare const userRoutes: OpenAPIHono<{
930
930
  length: number;
931
931
  tokens: {
932
932
  id: string;
933
+ user_id: string;
933
934
  created_at: string;
934
935
  client_id: string;
935
- user_id: string;
936
936
  rotating: boolean;
937
- login_id: string;
938
937
  device: {
939
938
  initial_user_agent: string;
940
939
  initial_ip: string;
@@ -943,6 +942,7 @@ export declare const userRoutes: OpenAPIHono<{
943
942
  last_ip: string;
944
943
  last_asn: string;
945
944
  };
945
+ login_id: string;
946
946
  resource_servers: {
947
947
  audience: string;
948
948
  scopes: string;
@@ -952,6 +952,7 @@ export declare const userRoutes: OpenAPIHono<{
952
952
  family_id: string;
953
953
  cascade_revocation: boolean;
954
954
  } | undefined;
955
+ organization?: string | undefined;
955
956
  expires_at?: string | undefined;
956
957
  session_id?: string | undefined;
957
958
  auth_connection?: string | undefined;
@@ -959,7 +960,6 @@ export declare const userRoutes: OpenAPIHono<{
959
960
  strategy: string;
960
961
  strategy_type: string;
961
962
  } | undefined;
962
- organization?: string | undefined;
963
963
  revoked_at?: string | undefined;
964
964
  idle_expires_at?: string | undefined;
965
965
  last_exchanged_at?: string | undefined;
@@ -969,11 +969,10 @@ export declare const userRoutes: OpenAPIHono<{
969
969
  } | {
970
970
  tokens: {
971
971
  id: string;
972
+ user_id: string;
972
973
  created_at: string;
973
974
  client_id: string;
974
- user_id: string;
975
975
  rotating: boolean;
976
- login_id: string;
977
976
  device: {
978
977
  initial_user_agent: string;
979
978
  initial_ip: string;
@@ -982,6 +981,7 @@ export declare const userRoutes: OpenAPIHono<{
982
981
  last_ip: string;
983
982
  last_asn: string;
984
983
  };
984
+ login_id: string;
985
985
  resource_servers: {
986
986
  audience: string;
987
987
  scopes: string;
@@ -991,6 +991,7 @@ export declare const userRoutes: OpenAPIHono<{
991
991
  family_id: string;
992
992
  cascade_revocation: boolean;
993
993
  } | undefined;
994
+ organization?: string | undefined;
994
995
  expires_at?: string | undefined;
995
996
  session_id?: string | undefined;
996
997
  auth_connection?: string | undefined;
@@ -998,7 +999,6 @@ export declare const userRoutes: OpenAPIHono<{
998
999
  strategy: string;
999
1000
  strategy_type: string;
1000
1001
  } | undefined;
1001
- organization?: string | undefined;
1002
1002
  revoked_at?: string | undefined;
1003
1003
  idle_expires_at?: string | undefined;
1004
1004
  last_exchanged_at?: string | undefined;
@@ -1081,7 +1081,7 @@ export declare const userRoutes: OpenAPIHono<{
1081
1081
  };
1082
1082
  };
1083
1083
  output: {
1084
- 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";
1084
+ type: "i" | "fs" | "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" | "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" | "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";
1085
1085
  date: string;
1086
1086
  isMobile: boolean;
1087
1087
  log_id: string;
@@ -1117,7 +1117,7 @@ export declare const userRoutes: OpenAPIHono<{
1117
1117
  } | undefined;
1118
1118
  }[] | {
1119
1119
  logs: {
1120
- 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";
1120
+ type: "i" | "fs" | "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" | "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" | "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";
1121
1121
  date: string;
1122
1122
  isMobile: boolean;
1123
1123
  log_id: string;
@@ -1158,7 +1158,7 @@ export declare const userRoutes: OpenAPIHono<{
1158
1158
  limit: number;
1159
1159
  length: number;
1160
1160
  logs: {
1161
- 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";
1161
+ type: "i" | "fs" | "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" | "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" | "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";
1162
1162
  date: string;
1163
1163
  isMobile: boolean;
1164
1164
  log_id: string;
@@ -127,7 +127,7 @@ export declare function initJSXRoute(ctx: Context<{
127
127
  terms_url?: string | undefined;
128
128
  privacy_url?: string | undefined;
129
129
  scope?: "local" | "shared" | "platform" | undefined;
130
- override?: "secrets" | "none" | "fields" | undefined;
130
+ override?: "none" | "secrets" | "fields" | undefined;
131
131
  enforce?: boolean | undefined;
132
132
  } | null;
133
133
  client: EnrichedClient;
@@ -243,7 +243,7 @@ export declare function initJSXRoute(ctx: Context<{
243
243
  pushed_authorization_requests_supported?: boolean | undefined;
244
244
  authorization_response_iss_parameter_supported?: boolean | undefined;
245
245
  deployment_type?: "shared" | "wfp" | undefined;
246
- provisioning_state?: "failed" | "pending" | "ready" | undefined;
246
+ provisioning_state?: "pending" | "failed" | "ready" | undefined;
247
247
  provisioning_error?: string | undefined;
248
248
  provisioning_state_changed_at?: string | undefined;
249
249
  bundle_configuration?: string | undefined;
@@ -315,7 +315,7 @@ export declare function initJSXRoute(ctx: Context<{
315
315
  } | undefined;
316
316
  allow_remember_browser?: boolean | undefined;
317
317
  remember_browser_lifetime_in_days?: number | undefined;
318
- policy?: "never" | "always" | "all-applications" | "confidence-score" | undefined;
318
+ policy?: "always" | "never" | "all-applications" | "confidence-score" | undefined;
319
319
  } | undefined;
320
320
  is_control_plane?: boolean | undefined;
321
321
  has_children?: boolean | undefined;
@@ -512,7 +512,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
512
512
  terms_url?: string | undefined;
513
513
  privacy_url?: string | undefined;
514
514
  scope?: "local" | "shared" | "platform" | undefined;
515
- override?: "secrets" | "none" | "fields" | undefined;
515
+ override?: "none" | "secrets" | "fields" | undefined;
516
516
  enforce?: boolean | undefined;
517
517
  } | null;
518
518
  client: EnrichedClient;
@@ -697,7 +697,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
697
697
  pushed_authorization_requests_supported?: boolean | undefined;
698
698
  authorization_response_iss_parameter_supported?: boolean | undefined;
699
699
  deployment_type?: "shared" | "wfp" | undefined;
700
- provisioning_state?: "failed" | "pending" | "ready" | undefined;
700
+ provisioning_state?: "pending" | "failed" | "ready" | undefined;
701
701
  provisioning_error?: string | undefined;
702
702
  provisioning_state_changed_at?: string | undefined;
703
703
  bundle_configuration?: string | undefined;
@@ -769,7 +769,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
769
769
  } | undefined;
770
770
  allow_remember_browser?: boolean | undefined;
771
771
  remember_browser_lifetime_in_days?: number | undefined;
772
- policy?: "never" | "always" | "all-applications" | "confidence-score" | undefined;
772
+ policy?: "always" | "never" | "all-applications" | "confidence-score" | undefined;
773
773
  } | undefined;
774
774
  is_control_plane?: boolean | undefined;
775
775
  has_children?: boolean | undefined;
@@ -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?: {
@@ -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?: {
@@ -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?: {
@@ -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?: {
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Wiring of the `pre-screen` trigger into universal login. Every u2 screen in
3
+ * the registry and the classic `/u` pages with the same screen fire it before
4
+ * the screen is shown (`render`) and when it is submitted (`submit`), so a
5
+ * direct POST can't skip a submit-time denial.
6
+ */
7
+ import { MiddlewareHandler } from "hono";
8
+ import { Bindings, Variables } from "../../types";
9
+ import type { ScreenDefinition } from "./screens/types";
10
+ /** The pre-screen screen name of a u2 screen id, if it is gated. */
11
+ export declare function getPreScreenName(screenId: string): string | undefined;
12
+ /** u2 screen ids that fire `pre-screen`. */
13
+ export declare function listPreScreenScreenIds(): string[];
14
+ /**
15
+ * Fire `pre-screen` for a u2 screen: `render` before its GET factory runs and
16
+ * `submit` before its POST handler. The screen a POST answers with (the next
17
+ * step, e.g. identifier → email code, or the same screen again) fires
18
+ * `render` too, since it is shown without a GET of its own.
19
+ */
20
+ export declare function withPreScreen(screenId: string, definition: ScreenDefinition): ScreenDefinition;
21
+ /**
22
+ * Fire `pre-screen` for a classic `/u` page: `render` on GET and `submit` on
23
+ * POST, before the route handler. Requests without a login session (`state`)
24
+ * are left to the route, which rejects them.
25
+ */
26
+ export declare function preScreenMiddleware(screenId: string, options?: {
27
+ submit?: boolean;
28
+ }): MiddlewareHandler<{
29
+ Bindings: Bindings;
30
+ Variables: Variables;
31
+ }>;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Change email screens - the u2 equivalent of /u/account/change-email,
3
+ * /u/account/change-email-verify and /u/account/change-email-confirmation.
4
+ *
5
+ * 1. account-change-email: the user enters a new address and a one-time code
6
+ * is emailed to it.
7
+ * 2. account-change-email-verify: the user enters the code; the address is
8
+ * changed (and marked verified) on the user and its linked identities, and
9
+ * a confirmation with a continue link is shown.
10
+ *
11
+ * Both work from a signed-in session (`/u2/account`, `screen_hint=change-email`)
12
+ * and mid-login, when a form hook redirects to change-email: the login session
13
+ * then carries the `change-email` continuation scope and the user comes from
14
+ * it instead of a session cookie, as on /u.
15
+ *
16
+ * Unlike /u, the new address is stored with the code rather than passed in the
17
+ * URL, so the address that ends up on the account is the one the code was sent
18
+ * to. Whether an address is taken is only revealed after the code for it has
19
+ * been entered, i.e. to someone who controls that inbox.
20
+ *
21
+ * Corresponds to: /u2/account/change-email and /u2/account/change-email/verify
22
+ */
23
+ import type { DataAdapters, LoginSession, Session, User } from "@authhero/adapter-interfaces";
24
+ import type { ScreenContext, ScreenDefinition, ScreenResult } from "./types";
25
+ /**
26
+ * Every user matching `q`, page by page. The offset listing returns linked
27
+ * identities as rows of their own, so a single page can be filled by the
28
+ * user's own identities and hide another owner.
29
+ */
30
+ export declare function listAllUsers(users: DataAdapters["users"], tenantId: string, q: string, pageSize?: number): Promise<User[]>;
31
+ /** Whether a user outside this account (the user and its linked identities) has `email`. */
32
+ export declare function isEmailTakenOutsideAccount(users: DataAdapters["users"], tenantId: string, email: string, userId: string, pageSize?: number): Promise<boolean>;
33
+ /**
34
+ * The user whose email is being changed. Mid-login (a form hook sent the user
35
+ * here, or to the account hub which links here) the login session's
36
+ * continuation scope authorizes the page and names the user; otherwise a
37
+ * signed-in session cookie is required.
38
+ *
39
+ * `continuationScope` is `change-email` when the hook targeted this page and
40
+ * `account` when the user came from the account hub mid-login.
41
+ */
42
+ export declare function resolveChangeEmailUser(context: ScreenContext): Promise<{
43
+ user: User;
44
+ session: Session | null;
45
+ loginSession: LoginSession;
46
+ isContinuation: boolean;
47
+ continuationScope?: string;
48
+ }>;
49
+ export declare function accountChangeEmailScreen(context: ScreenContext): Promise<ScreenResult>;
50
+ export declare const accountChangeEmailScreenDefinition: ScreenDefinition;
51
+ export declare function accountChangeEmailVerifyScreen(context: ScreenContext): Promise<ScreenResult>;
52
+ export declare const accountChangeEmailVerifyScreenDefinition: ScreenDefinition;
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Shared helpers for account management screens
3
3
  */
4
- import type { User, Session } from "@authhero/adapter-interfaces";
5
- import type { ScreenContext, ScreenFactory, ScreenHandler } from "./types";
6
- import type { AccountActionOperation } from "../../../types/Hooks";
4
+ import type { LoginSession, User, Session } from "@authhero/adapter-interfaces";
5
+ import type { ScreenContext } from "./types";
7
6
  /**
8
7
  * Resolve the authenticated user from the session cookie.
9
8
  * Used by all account screens that need the current user.
@@ -13,27 +12,23 @@ export declare function resolveAccountUser(context: ScreenContext): Promise<{
13
12
  session: Session;
14
13
  }>;
15
14
  /**
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.
15
+ * Resolve the account user either mid-login or from a session cookie.
16
+ *
17
+ * When a form hook redirects to an account page mid-login, the login session
18
+ * is AWAITING_CONTINUATION with a scope naming that page (`account`,
19
+ * `change-email`). That scope authorizes the page and names the user, so no
20
+ * session cookie is needed. The first of `scopes` the login session carries is
21
+ * returned as `continuationScope`; without one, a signed-in session cookie is
22
+ * required as on every other account page.
19
23
  */
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;
24
+ export declare function resolveAccountUserOrContinuation(context: ScreenContext, scopes: readonly string[]): Promise<{
25
+ user: User;
26
+ session: Session | null;
27
+ loginSession: LoginSession;
28
+ continuationScope?: string;
29
+ }>;
32
30
  /**
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.
31
+ * Where "continue" sends a user who reached an account page mid-login: the
32
+ * return URL stored when the continuation started (`/u2/continue?state=…`).
35
33
  */
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"]>;
34
+ export declare function getContinuationReturnUrl(loginSession: LoginSession): string | undefined;
@@ -1,6 +1,12 @@
1
1
  /**
2
2
  * Account screen - main hub for account management
3
3
  *
4
+ * Signed in (session cookie) it links to every account sub-screen. Mid-login,
5
+ * when a form hook redirects here, the login session carries the `account`
6
+ * continuation scope instead: the hub then shows the user, a change-email
7
+ * entry (the only sub-screen that accepts that scope) and a button that
8
+ * continues the login, matching what /u/account offered mid-login.
9
+ *
4
10
  * Corresponds to: /u2/account
5
11
  */
6
12
  import type { ScreenContext, ScreenResult, ScreenDefinition } from "./types";
@@ -13,8 +13,10 @@
13
13
  * - forgot-password: /u/forgot-password
14
14
  * - reset-password: /u/reset-password
15
15
  * - impersonate: /u/impersonate
16
- * - pre-signup: /u/pre-signup
17
- * - pre-signup-sent: /u/pre-signup-sent
16
+ *
17
+ * /u/pre-signup and /u/pre-signup-sent have no u2 screen: u2 signup creates
18
+ * the account directly and verifies the address afterwards, and redeems the
19
+ * `code` of pre-signup emails sent from /u (see screens/signup.ts).
18
20
  */
19
21
  export { identifierScreen } from "./identifier";
20
22
  export { emailOtpChallengeScreen } from "./email-otp-challenge";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Invalid session screen - a passwordless link was opened somewhere it can't
3
+ * complete (another browser or IP than the login started in, or the code had
4
+ * already been used or expired).
5
+ *
6
+ * Corresponds to: /u2/invalid-session (u2 equivalent of /u/invalid-session)
7
+ */
8
+ import type { ScreenContext, ScreenResult, ScreenDefinition } from "./types";
9
+ export declare function invalidSessionScreen(context: ScreenContext): Promise<ScreenResult>;
10
+ export declare const invalidSessionScreenDefinition: ScreenDefinition;